#include <stdio.h>
int main ()
{
int s ,d ,n , i ;
scanf ("%d",&n) ;
for (i=1 ;i<=n ;i++)
{
int x =0 , y=0 ;
scanf ("%d%d",&s, &d) ;
x = (s+d) /2 ;
y = (s-d) /2 ;
if (s>= d && s== x+y) printf ("%d %d\n", x ,y) ;
else printf ("impossible\n") ;
}
}
int main ()
{
int s ,d ,n , i ;
scanf ("%d",&n) ;
for (i=1 ;i<=n ;i++)
{
int x =0 , y=0 ;
scanf ("%d%d",&s, &d) ;
x = (s+d) /2 ;
y = (s-d) /2 ;
if (s>= d && s== x+y) printf ("%d %d\n", x ,y) ;
else printf ("impossible\n") ;
}
}