#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cstring>
#include <string>
using namespace std;
int po[100][100];
int x[100];
int y[100];
int main()
{
int n;
cin >> n;
po[0][n / 2] = 1;
x[1] = 0, y[1] = n / 2;
for (int i = 2; i <= n * n; i++)
{
if (x[i - 1] == 0 && y[i - 1] != n - 1)
{
po[n-1][y[i - 1]+1] = i;
x[i] = n - 1, y[i] = y[i - 1] + 1;
}
else if (x[i - 1] != 0 && y[i - 1] == n - 1)
{
po[x[i-1]-1][0] = i;
x[i] = x[i - 1] - 1, y[i] = 0;
}
else if (x[i - 1] == 0 && y[i - 1] == n - 1)
{
po[x[i - 1] + 1][y[i-1]] = i;
x[i] = x[i - 1] + 1, y[i] = y[i - 1];
}
else
{
if (po[x[i - 1] - 1][y[i - 1] + 1] == 0)
{
po[x[i - 1] - 1][y[i - 1] + 1] = i;
x[i] = x[i - 1] - 1, y[i] = y[i - 1] + 1;
}
else
{
po[x[i - 1] + 1][y[i - 1]] = i;
x[i] = x[i - 1] + 1, y[i] = y[i - 1];
}
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cout << po[i][j]<<' ';
}
cout << endl;
}
return 0;
}