n = int(input()) for _ in range(n): str1 = input().strip() str2 = input().strip() mid = len(str1) // 2 print(str1[:mid] + str2 + str1[mid:])