#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[22][22]={},cnt = 1,y=1,x=n/2+1+1;
cin >> n;
a[1][n/2+1] = cnt++;
while (cnt <= n * n)
{
if (--y == 0)
y = n;
if (++x > n)
x = 1;
if (a[y][x] == 0)a[y][x] = cnt++;
else
{
if (--x == 0)
x = n;
a[y][x] == cnt++;
}
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
cout << a[i][j] << " ";
cout << endl;
}
return 0;
}