#include <iostream> using namespace std; int main() { int A[101][101],n,x=1; cin>>n; for(int i=1;i<=n;i++) for(int j=1;i+j<=n+1;j++) if(i+j==n+1) A[i][j]=0; else A[i][j]=A[n+1-j][n+1-i]=x++; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) cout<<A[i][j]<<" "; cout<<endl; } return 0; }