#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[15][15]={0},i,j,n,h=1;
    cin>>n;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			a[i][j]=h;
			h++;
		}   
	}
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			cout<<setw(3)<<a[i][j];
		}
		cout<<endl;
	}
}

/**************************************************************
	Problem: 1184
	User: wngjinming
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/