#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define pb push_back
#define MOD 1000000007
#define ff first
#define ss second
#define pi pair<int,int>

void solve()
{
    int t;cin>>t;
    while(t--) {
        int a,b;cin>>a>>b;
        cout<<a-1<<" "<<b<<"\n";
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    solve();
    return 0;
}