s=gets.chop.chars t=s.max s.size.times{|i| y=s[i] if y!=t x=s.rindex t s[i]=t s[x]=y break end } $><