#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
	clock_t ti;
	ti=clock();
	int x,y;
	cin>>x>>y;
	cout<<x-1<<" "<<y<<"\n";
    ti=clock()-ti;
    cerr<<"time taken on test case "<<t<<":"<<((float)ti)/(CLOCKS_PER_SEC)<<"\n";
	}
    return 0;
}
