n=list(raw_input()) o=[] for i in range(len(n)): for j in range(i,len(n)): t=n[:] t[i],t[j]=t[j],t[i] o+=["".join(t)] print max(o)