#include<bits/stdc++.h>
#define breturn return
using namespace std;
int t, a, b;
int main() {
	cin >> t;
	for(int i = 0; i < t; i++) {
		cin >> a >> b;
		if(b) cout << a - 1 << " " << b << '\n';
		else cout << a << " " << b << '\n';
	}
}
