#include <iostream>

using namespace std;

int main()
{
    int t,i;
    cin >> t;
    int x[t],y[t];
    for (i=0;i<t;i++){
        cin >> x[i];
        cin >> y[i];
    }
    for (i=0;i<t;i++){
        cout << x[i]-1 << " " << y[i] << endl;
    }
    return 0;
}