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