s=gets.chop.chars;i=-1;s.any?{|c|t=s[i+=1,$$].max;c!=t&&(s[i],s[s.rindex t]=t,c)};$><