#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int n;
while(scanf("%d",&n)!=EOF){
int s,d;
while(scanf("%d %d",&s,&d)!=EOF){
if(s<d||(s+d)%2==1){
printf("impossible\n");
}else{
if((s+d)>(s-d)){
printf("%d %d\n",(s+d)/2,(s-d)/2);
}else{
printf("%d %d\n",(s-d)/2,(s+d)/2);
}
}
}
}
return 0;
}