import sys a=list(sys.stdin) i=0 while 1:s=' '*79;b=(s+a[i%7][:-1]+s)[i/7:80+i/7];print b[:50]+' *#'[(b[50]>s)*~(i%7==3)]+b[51:]+i%7/6*'\n';i+=1