#include<bits/stdc++.h>

using namespace std;

int main(){
    int Case;
    cin>>Case;
    while(Case--){
        int n,m;
        cin>>n>>m;
        cout<<n-1<<" "<<m<<endl;
    }
    return 0;
}
       			 			 	 		 	 	 			 	 	