#include<bits/stdc++.h>
using namespace std;
int hf[600][600];
int n,a,b,tmp=2;
int main(){
cin>>n;
hf[1][n/2+1]=1;
a=1;b=n/2+1;
for(int i=2;i<=n*n;i++){
if(a==1&&b<n){
a=n;b++;
hf[a][b]=i;
}
else if(a>1&&b==n&&hf[a-1][1]==0){
b=1;a--;
hf[a][b]=tmp;
tmp++;
}
else if(a==1&&b==n&&hf[2][b]==0){
a=2;
hf[a][b]=tmp;
tmp++;
}
else{
if(hf[a-1][b+1]==0&&a-1!=0){
a--;b++;
hf[a][b]=tmp;
tmp++;
}
else{
a++;
hf[a][b]=tmp;
tmp++;
}
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cout<<hf[i][j]<<' ';
}
cout<<endl;
}
return 0;
}
已被气哭