import sequtils,strutils,strscans,algorithm,math,future,macros template get*():string = stdin.readLine() #.strip() template `max=`*(x,y:typed):void = x = max(x,y) proc toSeq(str:string):seq[char] = result = @[];(for s in str: result &= s) let S = get().toSeq().mapIt(it.ord - '0'.ord) var ans = S.mapIt($it).join("").parseInt() for i in 0..< S.len: for j in i+1 ..< S.len: var s = S (s[i],s[j]) = (s[j],s[i]) ans .max= s.mapIt($it).join("").parseInt() echo ans