/*
	author: vlad_cpp
*/

#include <bits/stdc++.h>

#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define FOR(i, x, n) for (long long i = x; i < n; ++i)
#define deb(a) cerr << #a << '\n';
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int INF = 1e9 + 7;
const ld EPS = 1e-12;

void solve() {
	int x, y;
	cin >> x >> y;
	cout << (x - 1) << ' ' << y << '\n';
}

int main() {
/*#ifndef SIO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif*/
    int t = 1;
    cin >> t;
    while (t--)
    	solve();
    return 0;
}