#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin>>t; while(t--){ string s,t; cin>>s>>t; s+=s,t+=t; int a=s.size(),b=t.size(); bool f=false; rep(i,min(a,b)){ if(s[i]>t[i]){ cout<<'X'<b) cout<<'X'<