s = list(input()) pre = [] def list2int(x): x = "".join(x) return int(x) for i in range(len(s)): for j in range(len(s)): if i==j:continue a = s[i] b = s[j] s[j]=a s[i]=b pre.append(list2int(s)) print(max(pre))