import sys for line in sys.stdin: s, sub = line.split() p = 0 for i in range (len(s)): if s[i] > s[p]: p = i print (s[0:p+1] + sub + s[p+1:])