#include<bits/stdc++.h>
using namespace std;
//	1   2   3   4   5   6   7
//1	1   1   1   @   1   1   1
//2	1	1	@	1	@	1	1
//3	1	@	1	1	1	@	1
//4	@	1	1	@	1	1	@
//5	1	@	1	1	1	@	1
//6	1	1	@	1	@	1	1
//7	1	1	1	@	1	1	1
int main(){ 
int i,j,a[100][100]={1},n;
cin>>n;
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			a[i][j]=1;
		}
	}
	for(i=1;i<=n/2+1;i++){
		for(j=1;j<=n/2+1;j++){
			if(i+j==n/2+2){
				a[i][j]=0;
			}
		}
	}
	for(i=1;i<=n/2+1;i++){
		for(j=n/2+1;j<=n;j++){
			if(j-i==n/2){
				a[i][j]=0;
			}
		}
	}
	for(i=n/2+1;i<=n;i++){
		for(j=1;j<=n/2+1;j++){
			if(i-j==n/2){
				a[i][j]=0;
			} 	
		}
	}
	for(i=n/2+1;i<=n;i++){
		for(j=n/2+1;j<=n;j++){
			if(i+j==n+4){
				a[i][j]=0;
			}
		}
	}	
	a[n/2+1][n/2+1]=0;
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			cout<<setw(3)<<a[i][j];
		}
		cout<<endl;
	}
}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
/**************************************************************
	Problem: 1327
	User: linweilun
	Language: C++
	Result: Wrong Answer
****************************************************************/