#include<bits/stdc++.h>
using namespace std;
int main(){
    int i,j,n;
    int a[10][10];
    cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(i+j>=n+1) a[i][j]=n+1-j;
            else a[i][j]=i;
             
        } 
    }
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
		    cout<<setw(3)<<a[i][j];
        }
        cout<<endl;
}
}
/**************************************************************
	Problem: 1200
	User: yangjunwen
	Language: C++
	Result: Wrong Answer
****************************************************************/