#include using namespace std; int main(){ int a,b; scanf("%d%d",&a,&b); int x,y; x = (b - 2*a)/2; y = a - x; printf("%d %d\n",x,y); return 0; }