#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl "\n"
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define sz(x) (int)x.size()
#define ff first
#define ss second
typedef long long int ll;
using namespace std;

int main(){
    IOS;
    int t;
    cin>>t;
    while(t--){
    int x,y;
    cin>>x>>y;
    int a,b;
        a=x-1;
        b=y;
    
    cout<<a<<" "<<b<<endl;
    
   }
return 0;
}