#include<bits/stdc++.h>
using namespace std;
// use LLONG_MAX(the one you want) instead of LONG_MAX(INT_MAX)
#define endl "\n"
//#define int long long 
int mod=1e9+7;
//const int INF=1e18;
signed main(){
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);        
        int t=1;
        // cin>>t;
        while(t--){
             int n;
             cin>>n;
             vector<int> vc(n);
             for(int i=0;i<n;i++){
              cin>>vc[i];
             }
             int ans[n][n];
             memset(ans,-1,sizeof(ans));
             for(int i=0;i<n;i++){
                int x=i; int y=i;
                int cnt=0;
                while(cnt<vc[i]){
                   ans[x][y]=vc[i];
                   if(y!=0 && ans[x][y-1]==-1){
                    y--;
                   }
                   else{
                    x++;
                   }
                  cnt++;
                }
             }
            for(int i=0;i<n;i++){
              for(int j=0;j<=i;j++){
                cout<<ans[i][j]<<" ";
              }
              cout<<endl;
            }
         }
        return 0;
}