main=interact$f.f f=foldl(&)"" s&'#'=maximum(max(" 1"++map succ s)$take 1$max s$drop 50s):s s&x=x:s