#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j < n - i) {
                cout << setw(3) << n - i;
            } else {
                cout << setw(3) << j + 1;
            }
        }
        cout << endl;
    }int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j < n - i) {
                cout << setw(3) << n - i;
            } else {
                cout << setw(3) << j + 1;
            }
        }
        cout << endl;
    }
 	return 0;
}

/**************************************************************
	Problem: 1202
	User: sf751616
	Language: C++
	Result: Compile Error
****************************************************************/