/*
 * Name: leocp1
 * Time: 2021-04-23 11:11:58
 */
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(void)
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> p(n);
  for (auto & pi : p) {
    cin >> pi;
  }
  vector<ll> rv(n * n);
  const auto ix = [n](ll i, ll j) {
    return n * i + j;
  };
  for (ll i = 0; i < n; ++i) {
    ll d = 0;
    for (ll j = 0; j < n; ++j) {
      if (p[j] <= i) {
        continue;
      } else {
        rv[ix(i+d,d)] = p[j];
        d++;
      }
    }
  }

  for (ll i = 0; i < n; ++i) {
    for (ll j = 0; j <= i; ++j) {
      cout << rv[ix(i, j)] << " ";
    }
    cout << endl;
  }
  return 0;
}
