a = input().split() a = list(a[0] + a[1]) a[::2] = sorted(a[::2]) a[1::2] = sorted(a[1::2]) for i in a: if i.isdigit() or (i.isalpha() and i.upper()<'G'): print(hex(int( ''.join(reversed(bin(int(i.lower(),16) )[2:].rjust(4,"0"))) ,2))[2:].upper(),end='') else: print(i,end='')