def L(a,b,c,m): for i in range(m):x=" _"[b]*n;print((" |"[a]+x+"|"+x+" |"[c]).rstrip()) while 1: n=int(input()) for i in range(8):L(1