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