//P5725
#include<stdio.h>
int main()
{
int n,i,j,k,l,o;
int m=1;
scanf("%d",&n);
int num;
for(i=0;i<n;i++)
{
for(j=i*n+1;j<=(i+1)*n;j++)
{
printf("%02d",j);
}
printf("\n");
}
printf("\n");
for(k=1;k<=n;k++)
{
for(l=1;l<=n;l++)
{
if(l<=n-k)printf(" ");
else {printf("%02d",m); m++;}
}
printf("\n");
}
return 0;
}