#include<iostream>
#include<set>
#include<vector>
#include<map>
#include<iterator>
#include<stack>
#include<algorithm>
#include<cmath>
#define ll long long int
using namespace std;
#define mod 998244353
#define testcase ll t;cin>>t;while(t--)
#include<queue>
ll binpow(ll a, ll b)
{
	ll ans = 0, x = a;
	while (b)
	{
		if (b % 2)
			ans = (ans * x) % mod;
		x = (x * x) % mod;
		b /= 2;
	}
	return ans % mod;
}

ll ABS(ll n)
{
	if (n >= 0)
		return n;
	else
		return -n;
}

void solve()
{
	ll n, k, i, j,sum=0;
	cin >> n;
	vector<ll>a(n);
	for(i=0;i<n;i++)cin>>a[i];
	for(i=0;i<n;i++)sum+=a[i];
	ll ma=0,su=0;
	for(i=0;i<n-1;i++){
	    su+=a[i];
	    su=max((ll)0,su);
	    ma=max(ma,su);
	}
	su=0;
	for(i=n-1;i>=1;i--){
	    su+=a[i];
	    su=max((ll)0,su);
	    ma=max(ma,su);
	}
	    
	if(sum>ma)cout<<"YES\n";
	else cout<<"NO\n";
}
	        
	            
	        
	        
	        
	        
	        
int main(){
/*    ll i,j;
    vector<ll>s(100001,1);
    for(i=2;i*i<=100000;i++){
        if(s[i]==1){
            for(j=i*i;j<=100000;j+=i)
                s[j]=0;
        }
    }
    vector<ll>v;
    for(i=2;i<=100000;i++)
        if(s[i])v.push_back(i);
    //cout<<v.size()<<endl;
    testcase{
        ll n;
        cin>>n;
        vector<ll>res;
            for(i=0;i<v.size();i++){
                while(n%v[i]==0){
                    res.push_back(v[i]);
                    n/=v[i];
                }
            }
            if(n>1)res.push_back(n);
            //for(i=0;i<res.size();i++)
            //cout<<res[i]<<" ";
            ll cnt=0;
            pair<ll,ll>m;
            m.first=0;
            m.second=0;
            cnt=1;
            m.first=1;
            m.second=res[0];
            for(i=1;i<res.size();i++){
                if(res[i]==res[i-1])cnt++;
                else cnt=1;
                if(cnt>m.first){
                    m.first=cnt;
                    m.second=res[i];
                }
            }
           // cout<<m.first<<" "<<m.second;
          cout<<m.first<<endl;
           for(i=0;i<m.first-1;i++)
               cout<<m.second<<" ";
           ll ans=m.second;
           for(i=0;i<res.size();i++){
               if(res[i]!=m.second)ans*=res[i];
           }
           cout<<ans<<endl;
             
                
                
    }
    
            */
            testcase{
                   ll x,y;
                   cin>>x>>y;
                   cout<<x-1<<" "<<y<<endl;
            }
         
                    
}
