l=len(input()) u=0 while 1: try:input();u+=1 except:break print("#"*l) for c in range(~-u):print("#"+" "*(l-2)+"#") print("#"*l)