#include<bits/stdc++.h>
#define fer(i,a,b) for(re i = a ; i <= b ; ++ i)
#define re register int
#define x first
#define y second
typedef long long ll ;
using namespace std;
const int N =  1e6 + 10 , M = 1010 , inf = 0x3f3f3f3f , mod = 1e9 + 7 ;
int n ;
int a[N] ;
int s[M][M] ;
bool st[M][M] ;
int k ;
void dfs(int i , int j , int res)
{
    if(k == res) return ;
    if(i <= 0 || i > n || j <= 0 || j > n) return ;
    if(st[i][j]) return ;
    st[i][j] = true ;
    s[i][j] = res ;
    k ++ ;
    dfs(i,j-1,res) ;
    dfs(i+1,j,res) ;
}
int main()
{
    cin >> n ;
    fer(i,1,n)
    {
        cin >> a[i] ;
        s[i][i] = a[i] ;
    }
    
    fer(i,1,n)
        fer(j,1,n)
            if(i == j)
            {
                k = 0 ;
                dfs(i,j,s[i][j]) ;
            }
                
    fer(i,1,n)
    {
        fer(j,1,n)
            if(s[i][j] != 0) cout << s[i][j] << " " ;
        cout << endl;
    }
    return 0;
}
