o=input() a=o for i in range(len(o)): for j in range(len(o)): s=list(o) s[i],s[j] = s[j],s[i] s = "".join(s) if s>a: a=s print(a)