/** I can do this all day **/

#include <bits/stdc++.h>
using namespace std;

#define fatso                    \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define f(i, n) for (ll i = 0; i < n; i++)
#define fr(i, a, b) for (ll i = a; i < b; i++)
#define mem1(a) memset(a, -1, sizeof(a))
#define mem0(a) memset(a, 0, sizeof(a))

const int N = 1e6 + 10;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll inf = 8e18;
const int LOG = 22;

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main()
{
    fatso;
    int t;
    cin >> t;
    while (t--)
    {
        int a, b;
        cin >> a >> b;
        cout << a - 1 << " " << b << endl;
    }
    return 0;
}