#include<bits/stdc++.h>
#define line cout<<endl;
#define space cout<<" ";
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI 3.141592653589793238
typedef long long int ll;

using namespace std;

const ll N = 1e9+7;

void solve()
{
    ll n; 
    cin>>n; 

    int a[n][n]; 
    memset(a,0,sizeof(a)); 

    for(int i=0;i<n;i++){
        ll x; 
        cin>>x; 
        a[i][i] = x; 
    }

    // for(int i=0;i<n;i++){
    //     for(int j=0;j<n;j++){
    //         cout<<a[i][j]; space; 
    //     }
    //     line; 
    // }

    for(int i=0;i<n;i++){

        ll x = i; 
        ll y = i; 
        ll temp  = a[i][i]; 
        ll cnt = a[i][i] - 1; 

        while(cnt > 0){

            int a1,b1; 
            a1 = x; 
            b1 = y - 1; 

            if(a1 >=0 && a1 <n && b1 >=0 && b1 <n && a[a1][b1] == 0){
                a[a1][b1] = temp; 
                x = a1; 
                y = b1; 
                cnt--; 
                continue; 
            }

            a1 = x + 1; 
            b1 = y; 

            if(a1 >=0 && a1 < n && b1 >= 0 && b1 < n &&  a[a1][b1] == 0 ){
                a[a1][b1] = temp; 
                x = a1; 
                y = b1; 
                cnt--; 
                continue; 
            }

          
        }

    }

    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i >= j)
            cout<<a[i][j]; space; 
        }
        line; 
    }

}

int main()
{
   fast;
   ll t;
   t = 1;
   // cin>>t;

   while(t--)
   {
       solve();
       // cout<<endl;
   }

}