G='#' for s in open(0):T,G=s<'0'and(T,G+[''.join(min(x,c*len(x))for c in s[:-1])for x in T])or(G,[]) G+=map(print,T)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page