#include <bits/stdc++.h>
using namespace std;
long long n, a[25][25];
bool aa[25][25];
int main() {
cin >> n;
int sygh = 1;
int sygl = n / 2 + 1, ssgh = 1, ssgl = n / 2 + 1;
a[sygh][sygl] = 1;
aa[sygh][sygl] = 1;
for (int i = 2; i <= n * n; i++) {
sygh--;
if (sygh < 1) {
sygh = n;
}
sygl++;
if (sygl > n) {
sygl = 1;
}
if (aa[sygh][sygl] == 0) {
a[sygh][sygl] = i;
aa[sygh][sygl] = 1;
ssgh = sygh + 1;
if (ssgh > n) {
ssgh = 1;
}
ssgl = sygl;
} else if (aa[sygh][sygl] == 1) {
a[ssgh][ssgl] = i;
aa[ssgh ][ssgl] = 1;
sygh = ssgh;
sygl = ssgl;
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cout << a[i][j] << ' ';
}
cout << endl;
}
return 0;
}