```while True:
    try:
        s1, s2 = input().split()
#       第一步:合并两个字符串:
        s = list(s1 + s2)
#       第二步:对字符串排序:
        s[::2] = sorted(s[::2])
        s[1::2] = sorted(s[1::2])
#       第三步:字符转换:
        res = []
        for i in s:
            if i in '0123456789abcdefABCDEF':
                tmp = bin(int(i,16))[2:].rjust(4,'0')[::-1]
                res.append(hex(int(tmp,2))[2:].upper())
            else:
                res.append(i)
        print(''.join(res))
    except:
        break