#include<bits/stdc++.h>
using namespace std;
const int N = 40;
int a[N][N], num = 1, n, x, y;
int main()
{
scanf("%d", &n);
n = n * 2 - 1;
while (num <= n * n) {
if (num == 1)a[x = 1][y = (n+1)/2] = num++;
else if(x == 1 && y != n)a[x = n][y = y+1] = num++;
else if(x != 1 && y == n)a[x = x-1][y = 1] = num++;
else if(x == 1 && y == n)a[x = x+1][y = y] = num++;
else if(!a[x-1][y+1])a[x = x-1][y = y+1] = num++;
else a[x = x+1][y = y] = num++;
}
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
printf("%d%c", a[i][j], j == n ? '\n' : ' ');
return 0;
}