import math import copy s = list(input()) ls = len(s) def swap(a,b,c): x = copy.deepcopy(c) x[a], x[b] = x[b], x[a] return x swplist = [ [ (i,j) for j in range(i+1,ls) ] for i in range(ls)] stringlist = ["".join(s)] for i in range(len(swplist)): for j in range(len(swplist[i])): b, e = swplist[i][j][0], swplist[i][j][1] stringlist.append("".join(swap(b,e,s))) anslist = sorted(stringlist) print(anslist[-1])