#include <bits/stdc++.h>
using namespace std;
int n;
struct data {
  int d, id;
} a[200001];
bool operator<(data a, data b) { return a.d > b.d; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].d), a[i].id = 2 * i - 1;
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; ++i) printf("%d %d\n", a[i].id, a[i + 1].id);
  int mx = n;
  for (int i = 1; i <= n; ++i)
    if (i + a[i].d - 1 == mx) {
      printf("%d %d\n", a[mx].id, a[i].id + 1);
      a[++mx].id = a[i].id + 1;
    } else
      printf("%d %d\n", a[i].id + 1, a[i + a[i].d - 1].id);
}
