#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;
const int mxn=1e5+5;
const int inf=1e9;
void solve() {
	int x,y;
	cin>>x>>y;
	cout<<x - 1<<" "<<y<<endl;
	return;
	


}
int main() {

	int t=1;
	cin>>t;
	while(t--)solve();
	
}