#include<iostream>
#include<iomanip>
#include<stdio.h>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int totalline,i,lnum,dline,fl;
i=1;
totalline=n;
while(i<=n)
{
int temp=i;
lnum=n-i+1;
dline=i+1;
fl=1;
while(temp--)
fl+=temp;
while(lnum--)
{
if(lnum!=0)
printf("%d ",fl);
if(lnum==0)
printf("%d",fl);
fl+=dline;
++dline;
}
printf("\n");
i++;
}
}
return 0;
}