N=input() L=[] for i in range(len(N)): L.append(N[i]) #print(L) ans=[L] import copy for i in range(len(N)): for j in range(i+1,len(N)): A=copy.deepcopy(L) A[i],A[j]=A[j],A[i] ans.append(A) ans.sort(reverse=True) print("".join(ans[0]))