#include <bits/stdc++.h>
#define ll long long int
#define fastio cin.tie(NULL); ios::sync_with_stdio(false);
#define times(x) long long int x; cin>>x; while(x--)
using namespace std;
#define MODVAL 1000000007
#define read(vec) for(auto &x:vec){cin>>x;}
#define each(vec) for(auto x: vec){cout<<x<<" ";}cout<<"\n";
#define sortasc(vec) sort(vec.begin(),vec.end());
#define sortdes(vec) sort(vec.begin(),vec.end(),greater<long long int>());
ll modexp(ll a,ll b,ll c){
    ll ans = 1;
    a%=c;
    if(a==0){
        return 0;
    }
    while(b>0){
        if(b%2){
            ans = (ans*a)%c;
        }
        b/=2;
        a = (a*a)%c;
    }
    return ans;
}
int main(){
    fastio;
    times(timessss){
        ll a,b;
        cin>>a>>b;
        cout<<a-1<<" "<<b<<"\n";
    }
}