#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int a,b,N;
cin>>N
while(N--){
cin>>a>>b;
if(b>a || (a-b)%2==1){
cout<<"impossible"<<endl;
continue;
}
cout<<(a+b)/2<<" "<<(a-b)/2<<endl;
}
return 0;
}
(a+b)/2 + (a-b)/2 =a
(a+b)/2 - (a-b)/2 =b