i=int(raw_input())-1 v=" #" a=v*i b=v+"#"+" ##"*i+"\n" x="#"+a+"\n" y=" "+x print b,y,x*3,y,b