#include<iostream>
#include<string>
#include<cmath>
#include<cstring>
#include<climits>
#include<stdio.h>
#include<string>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<algorithm>
#define ll long long
using namespace std;
//#ifndef ONLINE_JUDGE
//     
//    freopen("alchemy_input.txt", "r", stdin); 
//    freopen("output.txt", "w", stdout);
int main()
{
	ll n,t,d,k,x,y,a,b,m;
	cin>>t;
	while(t--)
	{	
		cin>>n>>k;
		int diff=abs(n-k);
		cout<<n-1<<" "<<k<<endl;
	}
	return 0;	
}