N = list(input()) max = 0 k = 0 for i in range(len(N)-1,-1,-1): if max < int(N[i]): max = int(N[i]) k = i N[0],N[k] = N[k],N[0] print("".join(N))