1. 

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10812 (Beat the Spread!)
* http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1753
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.0, 05/07/2009
*
* Status : Accepted
* Runtime: 0.140
*/

import java.util.Scanner;

public class Main {

public static void main(String[] args)
{
//set up all needed variables
Scanner sc = new Scanner(System.in);
StringBuilder answer = new StringBuilder();
int a,b, amount, sum, diff;

amount = sc.nextInt();

for(int i=1;i<=amount;i++)
{
sum = sc.nextInt();
diff = sc.nextInt();

//impossible if diff > sum
if(diff > sum)
{
answer.append("impossible");
answer.append("\n");
continue;
}
else
{
a = (sum + diff)/2;
b = sum - a;
//only integer values are possible. Therefore, check the answer
if((a+b)!= sum || (a-b)!= diff || a<0 || b<0)
{
answer.append("impossible");
answer.append("\n");
continue;
}
else
{
answer.append(a);
answer.append(" ");
answer.append(b);
answer.append("\n");
continue;
}
}
}
System.out.print(answer.toString());
}
}