#include <bits/stdc++.h>

#define pb push_back
#define all(x) (x).begin(), (x).end()
#define el "\n"

using namespace std;

int v[550][550];

bool possible(int x, int y)
{
    if (y < 1 || v[x][y])
        return true;
    return false;
}

void dfs(int x, int y, int amount, int what)
{
    v[x][y] = what;
    if (amount == 0)
        return;
     if (possible(x, y-1)) dfs(x+1, y, amount - 1, what);
        else dfs(x, y-1, amount - 1, what);
}

void solve()
{
    int n;
    cin >> n;
    int a[n+1];
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = 1; i <= n; i++) {
        dfs(i, i, a[i]-1, a[i]);
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= i; j++)
            cout << v[i][j] << " ";
        cout << el;
    }
}

int main ()
{
    solve();
    return 0;
}
