a = input()
s = []
for i in a:
    if int(i) == 0:
        continue
    else:
        s.append(int(i))
if 2 in s and 5 in s:
    s[s.index(5)], s[s.index(2)] = s[s.index(2)], s[s.index(5)]
    print(*s[::-1], sep = '')
else:
    print(*s[::-1], sep = '')

