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