#pragma GCC optimise ("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;

#define all(h) h.begin(), h.end()
#define int long long

signed main () {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int tt=1;
    //cin >> tt;
    while (tt--){
        int n;
        cin >> n;
        vector<vector<int>> a(n,vector<int>(n,0));
        for (int i=0; i<n; ++i){
            cin >> a[i][i];
        }
        int cnt=1;
        for (int i=1; i<n&& cnt<a[0][0]; ++i){
            a[i][0]=a[0][0];
            cnt++;
        }
        cnt=1;
        for (int i=n-2; i>-1 && cnt<a[n-1][n-1]; --i){
            a[n-1][i]=a[n-1][n-1];
            cnt++;
        }
        for (int i=1; i<n-1; ++i){
            if (a[i][i]>1) {
                int pos1 = i, pos2 = i;
                int have=0;
                while (have<a[i][i] && pos1<n){
                    a[pos1][pos2]=a[i][i];
                    have++;
                    while (pos2-1>=0 && a[pos1][pos2-1]==0 && have<a[i][i]){
                        a[pos1][pos2-1]=a[i][i];
                        pos2--;
                        have++;
                    }
                    pos1++;
                }
            }
        }
        for (int i=0; i<n; ++i){
            for (int j=0; j<i+1; ++j){
                cout << a[i][j] << ' ';
            }
            cout << '\n';
        }
    }

    return 0;
}