c=50 a="" for x in open("../fd/0").read():x+=max(a[:~c:-50]+" ");b="# "==x;c+=b;a+=(`c`*b+x)[x>"!"] print a