//解方程 x=a+b,y=|a-b|,求a b
#include <stdio.h>
#include <time.h>
main()
{
    int n;
    scanf("%d",&n);
    while(n--)
    {
        int x,y,c;
        scanf("%d%d",&x,&y);
        c=x-y;
        if(x<y||c%2!=0)
        puts("impossible");
        else
        {
            c/=2;
            printf("%d %d\n",c+y,c);
        }
    }
 //   printf("%f\n",(float)clock()/CLOCKS_PER_SEC);
}