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

}

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