public class c004 {
public static void main(String[] args){
java.util.Scanner es = new java.util.Scanner(System.in);
while(es.hasNext()){
long num = es.nextLong();
for(int i=1;i<=num;i++){
int s = es.nextInt();
int d = es.nextInt();
if(s==d)System.out.println(((s+d)/2)+" "+((s-d)/2)); //s與d相等的狀況
if(s>d && (s+d)%2==0 )System.out.println(((s+d)/2)+" "+((s-d)/2)); //s>d且是2的倍數(二元一次解s與d的概念)
if(s>d && (s+d)%2!=0)System.out.println("impossible") ; //s>d但不是2的倍數(分數沒小數點的)
if(s<d)System.out.println("impossible") ;}} // s<d 不符合題目條件
}}