#include<bits/stdc++.h> using namespace std; int n; string s1,s2; int main(){ cin>>n; while(n--){ cin>>s1>>s2; s1.insert(s1.length()/2,s2); cout<<s1<<endl; } return 0; }