while 1:n=input();i=4*n;exec"i-=1;s=n*' _'[i>i%n<1];print' | '[i/n]+s+'|'+(s+' | '[i/n]).rstrip();"*i