#include<iostream>
using namespace std;
int main(){
long long n1, n2, k, vhod, izhod, A, B;
char c1,c2;
cin>>n1>>c1;
cin>>n2>>c2;
cin>>k;
vhod=k-n1;
izhod=k-vhod;

cout<<"\n";

cout<<n1<<" "<<c1<<"\n"<<n2<<" "<<c2<<"\n"<<k<<"\n"<<izhod;
return 0;
}
