#include <bits/stdc++.h>
using namespace std;
int a[119][119],b[110][110],n;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		for(int j=i;j<=n-1;j++)
		{
			cout<<j<<" ";
		}
		for(int k=n;k>=n-i+1;k--)
		{
			cout<<k<<" ";
		}
		cout<<endl;
	}
}