#include <bits/stdc++.h>

using namespace std;
#define forl(i,a,n) for(int i=a;i<n;i++)
#define fore(i,a,n) for(int i=a;i<=n;i++)
#define revforl(i,n) for(int i=n-1;i>=0;i--)
#define revfore(i,n) for(int i=n;i>0;i--)
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int,int>
#define li long int
#define lli long long int
#define mem(a) memset(a,0,sizeof(a))
#define CASE(t) cout<<"Case #"<<(t)<<": ";
#define LIMIT 1000000
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int maxn = 200000+10;
const int mod = 1000000007;

void run_case(){
    //CODE HERE
    int x,y;
    cin>>x>>y;
    cout<<x-1<<" "<<y<<endl;
}

int main()
{
    IOS
    int T;
    cin>>T;
    fore(t,1,T)
    {
        //CASE(t);
        run_case();
    }
}
