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