//2615589 2011-08-04 21:39:04 Accepted 2388 C 0 160 ylwh!
//2615587 2011-08-04 21:36:35 Wrong Answer 2388 C 0 160 ylwh!
//2615574 2011-08-04 21:29:22 Wrong Answer 2388 C 0 160 ylwh!
#include <stdio.h>
int main()
{
int n, s, d, x, y;
scanf("%d", &n);
while(n--)
{
scanf("%d%d", &s, &d);
x = s + d;
y = s - d;
if(x % 2 || y % 2 || y < 0)//条件竟然写错了.....Orz.....
printf("impossible");
else
printf("%d %d", x / 2, y / 2);
if(n) printf("\n");
}
return 0;
}