#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
while(n--)
{
string str1;
string str2;
//getchar吃回车
cin >> str1;
getchar();
cin >> str2;
getchar();
int len = str1.size() / 2;
str1.insert(len,str2);
cout << str1 << endl;
}
return 0;
}