#include <cstdio>
#include <iostream>
#define MAXN 101
using namespace std;

int n;
int f[MAXN][MAXN];
int x,y,g;

void circle(int d){
	y++;
	f[x][y] = g; g++; 
	for (int i = 1; i < d-1; i++){
		x--; f[x][y] = g; g++; 
	}
	y--;
	f[x][y] = g; g++; 
	for (int i = 1; i < d-1; i++){
		y--; f[x][y] = g; g++;
	}
	x++;
	f[x][y] = g; g++; 
	for (int i = 1; i < d-1; i++){
		x++; f[x][y] = g; g++;
	}
	y++;
	f[x][y] = g; g++; 
	for (int i = 1; i < d-1; i++){
		y++; f[x][y] = g; g++;
	}
		
}

int main(){
	freopen("F.in","r",stdin); freopen("F.out","w",stdout);
	scanf("%d",&n);
	x = n/2+1; 
	y = n/2+1;
	f[n/2+1][n/2+1] = 1;
	g = 2;
	for (int i = 3; i <= n; i+=2){
		circle(i);
	}
	for (int i = 1; i <= n; i++ ){
	for (int j = 1; j <= n; j++)
		printf("%d ",f[i][j]);
	printf("\n");
	}
	
	fclose(stdin); fclose(stdout);
	return 0;       
}