#include using namespace std; int main(){ int T; cin >> T; for (int i = 0; i < T; i++){ string x; cin >> x; string y; cin >> y; if (x + y > y + x){ cout << "X" << endl; } else if (x + y < y + x){ cout << "Y" << endl; } else if (x > y){ cout << "X" << endl; } else { cout << "Y" << endl; } } }