#include<stdio.h>
inline int read(){
	int x=0;
    char ch=getchar();
    while(ch<'0'){
        ch=getchar();
    }
    while(ch>='0'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x;
}
inline void write(int X)
{
	int s[7],top=0;			//s[***] as your wish
	while(X) {s[++top]=X%10; X/=10;}
	if(!top) s[++top]=0;
	while(top) putchar(s[top--]+'0');
}
int main(){
	int n;
	int a[505][505];
	n = read();
	
	for(int i = 0;i<n;++i){
		a[i][i] = read();
	}
	
	bool f;
	for(int i = 1;i<n;++i){
		f = false;
		for(int j = 0;j<n-i;++j){
			if(f){
				//printf("(1)");
				a[i+j][j] = a[i+j][j+1];
			}
			else{
				int t = a[i+j-1][j];
				if(t<=i){
					f = true;
					//printf("(2,%d,%d)",t,i);
					a[i+j][j] = a[i+j][j+1];
				}
				else{
					//printf("(2)");
					a[i+j][j] = t;
				}
			}
		}
	}
	
	for(int i=0;i<n;++i){
		for(int j = 0;j<i+1;++j){
			write(a[i][j]);
			putchar(' ');
		}
		putchar('\n');
	}
	return 0;
}
