#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
     
   int t;
   cin>>t;

   while(t--)
   {
     int n,m;
     cin>>n>>m;

     cout<<n-1<<" "<<m<<endl;
   }

     
  }


  