while 1:i=n=input();exec"a=i/n%4;i+=1;t=a>i%n<1;b=' _'[t]*n;print' | '[a]+b+'|'+b*(a/3|t)+a/3*'|';"*n*4
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page