#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[41][41] = {0};
int x = 1 , y = (n + 1) / 2;
for(int i = 1; i <= n * n; i++){
a[x-1][y-1] = i;
if(x == 1 && y != n){
x = n;
y ++;
}else if(x != 1 && y == n){
x --;
y = 1;
}else if(x == 1 && y == n){
x++;
}else if(x != 1 && y != n){
if(a[x][y] == 0){
x--;
y++;
}else{
x++;
}
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
cout << a[i][j] << ' ';
}
cout << endl;
}
return 0;
}