// created: 2025-05-21 10:49:24 #include #include #include #define F(i,l,r) for(int i=l,i##_end=r;i::value||is_same::value using namespace std; templateenable_if_t::value I128,void> readmain(T &x) { bool neg=false;int c=getchar(); for(;!isdigit(c);c=getchar())if(c=='-')neg=true; for(x=0;isdigit(c);c=getchar())x=(T)(10*x+(c-'0')); if(neg)x=-x; } templateT& read(T &x){readmain(x);return x;} templatevoid read(T &x,Tr&... r){readmain(x);read(r...);} constexpr int N=1005; int n; char s[6][N]; char &next(int x,int y) { int c=0; while(s[c][y]!='#'||x)x-=s[c++][y]=='#'; return s[c][y]; } int main() { read(n); if(n==1) { puts("0\n1\n1\n1\n0\n0"); return 0; } if(n==2) { puts("02\n13\n12\n13\n02\n03"); return 0; } if(n==3) { puts("012\n345\n345\n225\n141\n300"); return 0; } if(n==4) { printf(R"( 7446 3775 1664 0335 0225 0112 )"+1); return 0; } if(n==5) { printf(R"( 79746 98965 18435 07234 08622 01135 )"+1); return 0; } if(n==6) { printf(R"( 566991 355710 144180 033689 022477 011280 )"+1); return 0; } if(n==7) { printf(R"( 3568113 5487932 1437302 0356601 0427899 0112202 )"+1); return 0; } if(n==8) { printf(R"( 56655024 35579513 14498200 03368413 02247712 01128943 )"+1); return 0; } F(i,0,6)F(j,0,n)s[i][j]='#'; next(0,0)='4'; next(0,0)='4'; next(0,0)='4'; F(i,0,n-2) { next(1,i)="0123"[i&3]; next(1,i+1)="0123"[i&3]; next(1,i+2)="0123"[i&3]; } next(0,n-1)='4'; next(0,n-1)='4'; next(0,n-1)='4'; for(int i=n-2;~--i;) { next(0,i)="5678"[i&3]; next(0,i+1)="5678"[i&3]; next(0,i+2)="5678"[i&3]; } F(i,0,6)F(j,0,n)if(s[i][j]=='#')s[i][j]='9'; for(int i=6;~--i;)puts(s[i]); return 0; }