import sys
import re

def encrypt(x):
    if re.search(r'[a-fA-F0-9]', x):
        b = bin(int(x, 16))[2:].rjust(4, "0")[::-1]
        h = hex(int(b, 2))[2:].upper()
        return h
    else:
        return x


for line in sys.stdin:
    # step 1
    a = list(line.strip().replace(" ", ""))
    # step 2
    a[::2] = sorted(a[::2])
    a[1::2] = sorted(a[1::2])
    # step 3
    print("".join([encrypt(i) for i in a]))