while 1:
try:
s1, s2 = input().split()
s = list(s1 + s2)
except:
break
else:
s[::2]=sorted(s[::2])
s[1::2]=sorted(s[1::2])
for i in s:
try:
b=bin(int(i,16))[2:]
b='0'*(4-len(b))+b if len(b)<4 else b
b=b[::-1]
b=hex(int(b,2))[2:].upper()
print(b,end='')
except:
print(i,end='')