#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define debug(x) cerr << #x << " = "<< x << "\n"
#define shaman ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
const int N=501;
int g[N][N];
signed main(){shaman
    int n;
    cin >> n;
    for(int i=0;i<n;i++)
        cin >> g[i][i];
    for(int i=0;i<n;i++){int x=i,y=i;
        for(int k=0;k<g[i][i]-1;k++){
            if(x-1>=0&&g[y][x-1]==0){
                x--;
                g[y][x]=g[i][i];
            }
            else if(y+1<n&&g[y+1][x]==0){
                y++;
                g[y][x]=g[i][i];
            }
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<=i;j++)
            cout << g[i][j] << " ";
        cout << "\n";
    }
}
