#include #include int main() { int heads,legs,dog; while(scanf("%d%d",&heads,&legs)!=EOF) { dog = (legs-2*heads)/2; printf("%d %d\n", heads-dog, dog); } return 0; }