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


/**************************************************************
	Problem: 1404
	User: zhenghaoxuan
	Language: C++
	Result: Accepted
	Time:15 ms
	Memory:2072 kb
****************************************************************/