for(;s=readline(v=d="");print(v))for each(c in s)v+=c>d?d=c:d