bcdef
abbbc
 z
y
 reddit
abcdef
 abc
aaa
 y
z
 cbxz
aaaa

bccdb
 z
 dfdeed
 aab
 y
 abac

a = sorted(list(raw_input().strip()))
b = sorted(list(raw_input().strip()))
n = len(a)

i , j = 0 , n-1
ans = ""
count = 0
while True:
	if count < n:
		if a[i] <= b[j]:
 			ans += a[i]
 			i += 1
 		count += 1
 	else:
 		break
 	if count < n:
 		if b[j] >= a[i]:
 			ans += b[j]
 			j -= 1 
 		count += 1
 	else:
 		break

print ans
