#include <iostream>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int al, bob, ansa, ansb;
        cin >> al >> bob;
        al--;
        ansa = al;
        ansb = bob;
        cout << ansa << ' ' << ansb << endl;
    }
    return 0;
}
