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

bccdb
 z
 dfdeed
 aab
 y
 abac

from collections import deque
small = deque(sorted(input(), reverse=True))
big = deque(sorted(input()))
pre = ""
suf = ""
l = len(small)
while len(pre+suf) < l:
    if small[-1] < big[-1]:
        pre += small.pop()
    else:
        suf = small.popleft()+suf
    if len(pre+suf) < l:
        if big[-1] > small[-1]:
            pre += big.pop()
        else:
            suf = big.popleft()+suf
print(pre+suf)