#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <random>
#include <set>
#include <vector>
using namespace std;

#define ll long long int
int64_t INF64 = int64_t(2e18) + 5;
int INF = int(1e5) + 5;

// Problem C

void solve() {
	int N;
	cin >> N;
	vector<int> p(N);

	for (auto &it : p)
		cin >> it;

	vector<vector<int>> fillomino(N, vector<int> (N, -1));
	for (int i = 0; i < N; i++) {
		int x = i, y = i;

		fillomino[x][y] = p[i];
		for (int r = 1; r < p[i]; r++) {
			if (y > 0 && fillomino[x][y - 1] == -1) 
				y--;
			else 
				x++;
			
			fillomino[x][y] = p[i];
		}
	}

    for (int i = 0; i < N; i++) {
        for (int j = 0; j <= i; j++) {
            if (j > 0)
                cout << " ";
            cout << fillomino[i][j];
        }
        cout << '\n';
    }


}

int main() {

    ios::sync_with_stdio(false); 
    cin.tie(NULL), cout.tie(NULL);

// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output1.txt", "w", stdout);
// #endif

    int testcases = 1;
    // cin >> testcases;

    while (testcases-- > 0) {
        solve();
    }
}