import java.util.*;
public class uva10812 {
public static void main(String [] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
for(int x=0;x<n;x++) {
int z = scn.nextInt();
int y = scn.nextInt();
if((z+y)%2==0 &&(z-y)%2==0) {
if(z < y)
System.out.println("impossible");
else {
int a = (z+y)/2;
int b = a-y;
System.out.println(a +" " +b);
}
}
else
System.out.println("impossible");
}
}
}