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

bccdb
 z
 dfdeed
 aab
 y
 abac

oleg=sorted(raw_input())

igor=sorted(raw_input(),reverse=True)
n=len(oleg)
ans=''
i=0
flag=0
while(len(ans)<n):
    if(oleg[i]>igor[i]):
        flag=1
        break
    else:
        ans=ans+oleg[i]+igor[i]
        i+=1
if (flag==1):
    while(len(ans)<n):
        ans=ans+igor[i]+oleg[i]
        i+=1
if(len(ans)==n):
    print ans
else:
    print ans[0:len(ans)-1]
    
    
        
