#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n;cin>>n;
n--;
int temp=0,sum=1,sumi=0,sumj=0;
for(int i=0;i<=n;i++)
{
sum+=sumj;
temp=sum;
sumi=sumj+2;
for(int j=0;j<=n-i;j++)
{
if(j==n-i&&i==n)
printf("%d\n",temp);
else if(j==n-i&&i!=n)
printf("%d\n",temp+sumi);
else if(j==0)
printf("%d ",temp);
else
{
temp+=sumi;
sumi++;
printf("%d ",temp);
}
}
sumj++;
}
return 0;
}