#include <bits/stdc++.h>
#include <numeric>
using namespace std ;
#define ll long long int
#define ull unsigned long long int
#define s(a) scanf("%lld",&a)
#define For(i,n) for(i=0;i<n;i++)
#define FOR(i,n) for(i=1;i<=n;i++)
#define pie acos(-1.0)
//#define cin std::cin
//#define cout std::cout
ll test, flag,R ,G,B,a,b, n,i,p,q,sum,S,l,r, m,Y,z,XD,j,j_1,k,k1,res ,min_ ,flag1,max_,XD1,count_,s_size ;
char ch ,ch_1 ;
string s,s1,s3;
char c2[10100];
ll pl,x,y,mi,c,d, u,v ,arr[11000110],arr_sum[5000500],ans,arr_plus[5000010],bro[10000100];
char garbage,garbage1 ;

struct voxchod{
  ll a,b ;
} ;
bool comp(voxchod x, voxchod y) {
    return x.a < y.a ;
} 
bool com(ll a, ll b) {
  return a > b ; 
}
ll dx[8] = {0,0, -1, 1,-1,-1,1,1} ;
ll dy[8] = {-1, 1, 0, 0,-1,1,-1,1} ;


int main()
{
           //ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
          cin >> test ;
          while(test--)
          {
            //cin >> n ;
            cin >> a >> b ;
            if(a==1)
            {
              cout << "0" <<  " " << b << endl ;
              continue ;
            }
            if(b>=a)
            {
              cout << a-1 << " " << b << endl ;
              continue ;
            }
            if(a>b)
            {
              cout << a-1 << " " << b << endl ;
            }


          }

           return 0;
            }
              