import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
while(num-->0){
int s = scanner.nextInt();
int d = scanner.nextInt();
int a,b;
if(s<d){
System.out.println("impossible");
}else{
if((s+d)%2==0){
a = (s+d)/2;
b = s-a;
if(b>a){
int temp = a;
a = b;
b = temp;
}
System.out.println(a+" "+b);
}else{
System.out.println("impossible");
}
}
}
}
}