#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int ans(int n, int num,int step) {
  
  

     if(num<0 and num<step)
      return INT_MAX;
  
    

    if(num>n)
      return num-n;

    if(n == num) 
    {
       
        return 0;
    }
   int x=ans(n, num - 1, step + 1);
  
   int y=ans(n, num + step,step+1);

   return 1+min(x,y);
}
int main() 
{

      #ifndef ONLINE_JUDGE
   
   
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);  
   
      #endif
      ll t,x,y;
      cin>>t;
      while(t--)
      {
        cin>>x>>y;
        cout<<x-1<<" "<<y<<endl;

      }

  return 0;
}



