#include <bits/stdc++.h>
using namespace std;
int main()
{
int a[20][20]={0};
int n;
cin >>n;
int x = 1;
for(int i=0;i<n;i++)
{
for(int j =0;j<n;j++)
{
a[n-1-i][n-1-j] = x;
x++;
}
}
for(int i=0;i<n;i++)
{
for(int j =0;j<n;j++)
{
cout<<setw(3)<<a[i][j];
}
cout <<endl;
}
return 0;
}
/**************************************************************
Problem: 1188
User: mariooo
Language: C++
Result: Accepted
Time:10 ms
Memory:2072 kb
****************************************************************/