while 1: c="0";b=[] for e in input(): \x09if e<c[-1]:c=[];b+=[c] \x09c+=[e] print`sum(sorted(b),[])`.replace(" ","")
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page