#include<bits/stdc++.h>
using namespace std;
int a[110][110];
int main(){
int n;
cin >> n;
int l = 1,r = n,cnt = n*n;
while(l<=r){
for(int i = l;i<=r;i++){
a[i][r] = cnt--;
}
for(int i = r-1;i>=l;i--){
a[r][i] = cnt--;
}
for(int i = r-1;i>=l;i--){
a[i][l] = cnt--;
}
for(int i = l+1;i<=r-1;i++){
a[l][i] = cnt--;
}
l++;
r--;
}
for(int i = 1;i<=n;i++){
for(int j = 1;j<=n;j++){
printf("%8d",a[i][j]);
}
cout << endl;
}
return 0;
}