#include <stdio.h>
int main(){
int n, i = 0, j = 0, a[120][120] = {0}, tot = 0;
scanf("%d", &n);
int num = a[0][0] = 1;
while (num < n*n){
while (j+1 < n && !a[i][j + 1]){
a[i][++j] = ++num;
}
while (i +1 < n && !a[i + 1][j]){
a[++i][j] = ++num;
}
while (j-1 >= 0 && !a[i][j - 1]){
a[i][--j] = ++num;
}
while (i -1>= 0 && !a[i - 1][j]){
a[--i][j] = ++num;
}
}