#include<bits/stdc++.h>
using namespace std;
int n, i, j, k, l, a[504][504];
int main() {
    for (scanf("%d", &n); i++ != n; scanf("%d", a[i] + i));
    for (i = 0; i++ != n;)
        for (l = a[j = i][k = i]; --l;
            1 == k || a[j][k - 1] ? ++j : --k, a[j][k] = a[i][i]);
    for (i = 0; i++ != n; printf("\n"))
        for (j = 0; j++ != i; printf("%d ", a[i][j]));
    exit(0);
}