n = list(input()) m = 0 for i in range(len(n)): if int(n[i]) >= m: m = int(n[i]) idx = i if idx != 0: n[0], n[idx] = str(m), n[0] print("".join(n))