#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
int main()
{
    int T;
    cin>>T;
    while(T--)
    {
      int a,b;
      cin>>a>>b;
      cout<<a-1<<' '<<b<<endl;
    }
return 0;
}

	 						  	 		  		 		 	 	 		 		