insert word length by twobit (srsly no import)

w=s=""
for x in raw_input()+" ":
\x09w+=x
\x09if"A">x:s+="%d_"%~-len(w)*(w>x)+w;w=""
print s

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top