1. 
/** * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* * Problem: 10812 - Beat the Spread!
* * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1753
* * Savkina Ekaterina
* * @version 1.0, 29/04/2010
* * Status : Accepted
* * Runtime: 0.152 */
package Scores;

import java.util.Scanner;

public class Scores {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
int countCase = sc.nextInt();
int a, b;
int sum;
int diff;
for (int i = 1; i <= countCase; i++) {
a = sc.nextInt();
b = sc.nextInt();
sum = a + b;
diff = a - b;
if (a >= b) {
if ((sum % 2 == 0) && (diff % 2 == 0)) {
System.out.println((a + b) / 2 + " " + (a - b) / 2);
} else
System.out.println("impossible");
} else
System.out.println("impossible");
}
}
}