Here is your task. You are given two strings and you have to merge/compress them in single string with minimum length such that both strings can be found (one at a time) by breaking that merged string into two parts.
NOTE:
String s2 should follow string s1.

INPUT
First line contain number of test cases T. Each test case contains two strings s1 and s2.
OUTPUT
Print merged string.
Constraints
1 ≤ T ≤ 100
1 ≤ length of strings ≤10^6

SAMPLE INPUT
2
roadshow
showman
tarun
tarunnum

SAMPLE OUTPUT
roadshowman
tarunnum
from sys import stdin
t = int(stdin.readline())
def com(a,b):
	l1 = len(a)
	l2 = len(b)
	l = l1

	if l2<l:
		l = l2
	while l>=1:
		#print "comparing ",a[-l:],b[:l]
		if a[-l:] == b[:l]:
			return l
		l-=1
	return 0
for tt in xrange(t):
	a = stdin.readline().strip();
	b = stdin.readline().strip()
	fir = com(a,b)
	
	print a + b[fir:]