#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int h,f,j,t;
cin>>h>>f;
j=(4*h-f)/2;
t=h-j;
cout<<j<<" "<<t<<endl;
return 0;
}
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int h,f,j,t;
cin>>h>>f;
j=(4*h-f)/2;
t=h-j;
cout<<j<<" "<<t<<endl;
return 0;
}