#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ll long long
#define sc(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
const ll mod=1e9+7;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll ap(ll a,ll b)
{
	return ((a%mod)*(b%mod))%mod;
}
ll ad(ll a,ll b)
{
	return ((a%mod)+(b%mod))%mod;
}
ll ksm(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b%2==1)
		{
			res=ap(res,a);
		}
		a=ap(a,a);
		b/=2;
	}
	return res; 
}
int main(int argc, char** argv) {
	int T;
	cin>>T;
	
	while(T--)
	{
		int x,y;
		sc(x);
		sc(y);
		int ansa=0,ansb=0;
		ansb=y;
		ansa=x-1;
		cout<<ansa<<" "<<ansb<<endl;
	}
	return 0;
}