#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, s, d;
cin >> n;
for ( i = 0; i < n; i ++) {
cin >> s >> d;
if ( ( s < d) || ( s + d) % 2) {
cout << "impossible" << endl;
} else {
cout << ( s + d) / 2 << " " << ( s - d) / 2 << endl;
}
}
}