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