#include<iostream>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int ans[1001][1001];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int hang=1;
int i=0,j=0;
int cnt=1;
while(hang<=n)
{
while(i>=0)
{
ans[i][j]=cnt;
cnt++;
i--;
j++;
}
hang++;
i=hang-1;
j=0;
}
for(int i=0;i<n;i++)
{
for(int j=0;j<(n-i);j++)
{
printf("%d",ans[i][j]);
if(j<n-i-1)printf(" ");
}
printf("\n");
}
}
}