#pragma optimize ("g",on)
#pragma GCC optimize ("Ofast,unroll-loops,03")
#pragma GCC target ("avx,avx2,fma")

#include <bits/stdc++.h>
 
#define nl "\n"
#define pb push_back
#define E exit(0)
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define sz(s) (s).size()

using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
 
const int N=1e6+5;
const int INF=1e9+7;
const int eps=1e-6;

void solve() {
	int x,y;
	cin>>x>>y;
	cout<<x-1<<' '<<y<<nl;
}
    
ll test=1;

int main () {
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
    ios_base::sync_with_stdio(0);
	cin.tie();
	cin>>test;
    while (test--) solve();
    return 0;
}