#include<bits/stdc++.h>
#define ll      unsigned long long int
#define ld      long double
#define pll 	pair<ll,ll>
#define vll 	vector<ll>
#define pb      push_back
#define fastIO 	ios_base::sync_with_stdio(0);\
               	cin.tie(NULL);\
               	cout.tie(NULL)
using namespace std; 
// for(i=0;i<n;i++){
	
// }
void solve(){
ll n,i,ans=0,x,y,xa=0,ya=0;
cin>>x>>y;
x--;
// if(x==y)
// {
// 	xa=x,ya=y;
// }
// else
// {
	
//  if(x>y)

// {
// 	xa=x-y+1;
// }
// else
// ya=y-x;
// }
cout<<x<<" "<<y<<"\n";

}


int main(){
	fastIO;
 
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	// freopen("output.txt", "w", stdout);
	#endif
 	ll t=1;
 	cin>>t;
 	while(t--)
 		solve();


	#ifndef ONLINE_JUDGE
	// cout<<endl<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec"<<endl;
	#endif
 
	return 0;
}