#include "bits/stdc++.h"
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, xx, current, it = 0, copy, x, y, flag;
	cin >> n;
	short **a = new short *[n];
	for (int i = 0; i < n; i++)
		a[i] = new short[n];
	short aa[n];
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			a[i][j] = -1;
		}
	}
	for (int i = 0; i < n; i++)
	{
		cin >> xx;
		a[i][i] = xx;
		aa[i] = xx;
	}

	while (it < n)
	{
		copy = a[it][it];
		--copy;
		x = it;
		y = it;
		while (copy > 0)
		{
			if (a[x][y - 1] == -1 && y - 1 >= 0 && copy > 0)
			{
				a[x][--y] = a[it][it];
				copy--;
			}
			else if (a[x + 1][y] == -1 && x + 1 < n && copy > 0)
			{
				a[++x][y] = a[it][it];
				copy--;
			}
		}
		++it;
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			cout << a[i][j] << " ";
		}
		cout << "\n";
	}

	return 0;
}