import java.util.Scanner;
public class Main{
public static void main(String agrs[]){
Scanner sc = new Scanner(System.in);
int i, j, k;
int N = sc.nextInt();
for (i=0; i<N; i++){
int A = sc.nextInt(); int B = sc.nextInt();
int large = (A+B)/2;
int small = (A-B)/2;
if (large<0 || small<0 || (A+B)%2 != 0 || (A-B)%2 != 0) System.out.println("impossible\n");
else System.out.printf("%d %d\n", large, small);
}
}
}
왜 pe가 뜨는거죠?