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

bccdb
 z
 dfdeed
 aab
 y
 abac

a = input()
b = input()

oleg = []
igor = []

cont = 0
for i in a:
	oleg.append(i)
	cont += 1
for i in b:
	igor.append(i)

oleg.sort()
igor.sort()


a = 0
ans = ''
ans2 = ''
for i in range(cont):
	#print(oleg[i],end= '')
	if oleg[i] <= igor[cont -i -1]:
		ans = ans + oleg[i]
	else:
		ans2 = ans2 + oleg[i]
	a += 1
	if a == cont:
		break
	#print(igor[cont-i-1],end ='')
	if igor[cont -i -1] >= oleg[i + 1]: 
		ans = ans + igor[cont - i -1]
	else:
		ans2 = ans2 + igor[cont - i -1]
	a += 1
	if a == cont:
		break

c = len(ans2)
for i in range(c):
	ans = ans + ans2[c-1-i]
print(ans)
