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