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