//分数必须是整数,否则impossible
#include<stdio.h>
int main(){
int n,x,y;
scanf("%d",&n);
while(n--){
scanf("%d%d",&x,&y);
if(y>x||(x + y)*1.0/2-(x + y)/2>0||(x - y) *1.0/ 2-(x - y) / 2>0) printf("impossible\n");
else printf("%d %d\n",(x + y)/2,(x - y) / 2);
}
return 0;
}