/*
#include <stdio.h>
int main ()
{
int arr [101][101]={0};
int i,j,n,k=1;
scanf ("%d",&n);
for (i=n-1; i>=0; i--)
{
for (j=n-1; j>=0; j--)
{
arr[i][j]=k++;
}
}
for (i=n-1; i>=0; i--)
{
for (j=0; j<n; j++)
{
printf("%d ",arr[i][j]);
}
printf("\n");
}
}
*/
/*
#include <stdio.h>
int main ()
{
int arr [101] [101]={0};
int i,j,n,k=1;
scanf ("%d",&n);
for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
arr [i] [j]=k++;
}
}
for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
printf ("%d ",arr[j] [i]);
}
printf("\n");
}
}
*/
#include <stdio.h>
int main ()
{
int arr [101] [101]={0};
int i,j,n,k=1;
scanf ("%d",&n);
for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
arr [i] [j]=k++;
}
for (i=0; i<n; j++)
{
printf ("%d ",arr[j] [i])
}
}
}