l = input() m = l.rfind(max(l)) l = list(l) for i in range(len(l)): if l[i] != max(l): l[i],l[m] = l[m],l[i] break print(''.join(l))