int main() { int head,foot; scanf("%d %d",&head,&foot); printf("%d %d",(foot-2*head)/2,head-(foot-2*head)/2); return 0; }