#include <iostream>
#include <cstdio>
#include <fstream.h>

using namespace std;

int main(){
 
 ifstream input;
 ofstream output;
 int M[101][101]; 

 int N;
 
 int sh;
 int jt;
 int it;
 
 int in;
 int jn;
 
 int i;
 int j;
 long k;
 
 input.open("F.in");
 output.open("F.out");
 input>>N;
 
 it = int(N/2+1);
 jt = int(N/2+1);
 M[it][jt] = 1;
 jt++;
 M[it][jt] = 2;
 it--;
 M[it][jt] = 3;
 
 sh = 2;
 
 in = 0;
 jn = -1;
  
 k=4;
 while(k<=(N*N)){
	for (i=1; i<=2; i++){
		for (j=1; j<=sh; j++){
			it+=in;
			jt+=jn;
			M[it][jt] = k;
			k++;	
		}
		if (in==0){
			if (jn==-1) 
				in=1;
			if (jn==1)  
				in=-1;	  
			jn=0;
		}
		else{
			if (in==-1)
				jn=-1;
			if (in==1)
				jn=1;
			in=0;
		} 
	}
	sh++;
	
 }

 
 for (i=1; i<=N; i++){
 	for (j=1; j<=N; j++){
		output<<M[i][j]<<" ";
	}
 	output<<endl;
 }
 
 input.close();
 output.close();
return 0;
}