//Created by Hemant Raj
#include <bits/stdc++.h> 
#include <iomanip>
#include<algorithm>
#include<vector>
#include<string>
#include <unordered_map> 
#include<set>
using namespace std; 
#define max(a, b) (a < b ? b : a) 
#define min(a, b) ((a > b) ? b : a) 
#define mod 1e9 + 7 
#define INF 1000000000000000003 
typedef long long int ll; 
typedef vector<int> vi;
typedef vector<vector<int>> vvi; 
typedef pair<int, int> pi; 
#define lb                   lower_bound
#define ub                   upper_bound
#define mine                *min_element
#define maxe                *max_element
#define pb   push_back
#define POB pop_back 
#define MP make_pair 
#define F                    first
#define S                    second
#define ceil(x,a)             ((x + a - 1) / (a))
#define all(v)               v.begin(), v.end()

#define read_ar(ar, n,k)           for (int ele = k; ele < n+k; ele++)cin>>ar[ele];
#define print_ar(ar, n,k)          for (int ele = k; ele < n+k; ele++)cout<<ar[ele]<<" ";
//Prime_Seive
bool prime[1000000+1]; void seive(){ ll N=1e6+1; memset(prime,true,sizeof(prime)); prime[0]=false; prime[1]=false; for(ll i=2;i*i<=N;i++){ if(prime[i]){ for(ll j=i*i;j<=N;j+=i){ prime[j]=false;}}}}

// check whether the given number is pow of 2
bool isPowerOfTwo(int x) {return (x && !(x & (x - 1)));}
  bool is_prime(int n){
             if(n==1) return false;
            for(int i=2;i<=sqrt(n);i++){
                       if(n%i==0){
                            return false;      
                       }
            }
            return true;
  
}/*
int arr1[10001];
int N=1e4+1;

void hemant(){
     int x; cin>>x;
     int t=lb(arr1,arr1+N,x)-arr1;
     if(arr1[t]==x){
           cout<<t<<endl;
           return;
     }
     int k=arr1[t]-x;
     int t1=lb(arr1,arr1+N,k)-arr1;
     if(arr1[t1]==k){
           cout<<t+1<<endl;
     }
     else{
           cout<<t+abs(arr1[t]-x)<<endl;
     }
}


*/
void hemant(){
      int x,y; cin>>x>>y;
      cout<<x-1<<" "<<y<<endl;
}





int main(){
      /*
      arr1[1]=1;
      for(int i=2;i<=10000;i++){
            arr1[i]=arr1[i-1]+i;
      }
      */
     int t=1; 
    cin>>t;
     while(t--){
          hemant();
     }
     return 0;       
}













