#include<bits/stdc++.h>
using namespace std;
#define ll long long


void solve()
{
    ll x,y;
    cin>>x>>y;
    cout<<x-1<<" "<<y<<"\n";
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //ll res = fun(0,1000000,1);
    int t=1;
    cin>>t;
    while(t--)
    solve();
    return 0;
}