a=c,n="a\n" for i in raw_input():c=chr(ord(c)+1);a=(a.replace(n,c+n),a+c*a.find(n)+n)[i>a] print a
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page