#include<iostream>
using namespace std;
int main() {
int n, sum, abs, big, small;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> sum >> abs;
big = (sum + abs) / 2;
small = big - abs;
if ((sum + abs) % 2)
cout << "impossible" << endl;
else if (big < 0 || small < 0)
cout << "impossible" << endl;
else
cout << big << " " << small << endl;
}
return 0;
}
#include
using namespace std;
int main() {
int n, sum, abs, big, small;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> sum >> abs;
big = (sum + abs) / 2;
small = big - abs;
if ((sum + abs) % 2)
cout << "impossible" << endl;
else if (big < 0 || small < 0)
cout << "impossible" << endl;
else
cout << big << " " << small << endl;
}
return 0;
}
#include
using namespace std;
int main() {
int n, sum, abs, big, small;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> sum >> abs;
big = (sum + abs) / 2;
small = big - abs;
if ((sum + abs) % 2)
cout << "impossible" << endl;
else if (big < 0 || small < 0)
cout << "impossible" << endl;
else
cout << big << " " << small << endl;
}
return 0;
}