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