#include <bits/stdc++.h>
using namespace std;
int n, cnt, lian[200010];
struct node {
  int u, v, dis;
} d[200010];
struct Edge {
  int u, v;
} e[200010];
bool cmp(node a, node b) { return a.dis > b.dis; }
bool cmp2(Edge a, Edge b) {
  if (a.u == b.u) return a.v < b.v;
  return a.u < b.u;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    d[i].u = 2 * i - 1;
    d[i].v = 2 * i;
    scanf("%d", &d[i].dis);
  }
  sort(d + 1, d + n + 1, cmp);
  for (int i = 1; i <= n; i++) lian[i] = d[i].u;
  for (int i = 1; i <= n - 1; i++) {
    e[++cnt].u = min(d[i].u, d[i + 1].u);
    e[cnt].v = max(d[i].u, d[i + 1].u);
  }
  int pos = n;
  for (int i = 1; i <= n; i++) {
    if (d[i].dis + i - 1 < pos) {
      e[++cnt].u = lian[i + d[i].dis - 1];
      e[cnt].v = d[i].v;
    } else {
      pos++;
      lian[pos] = d[i].v;
      e[++cnt].u = min(d[i].v, lian[pos - 1]);
      e[cnt].v = max(d[i].v, lian[pos - 1]);
    }
  }
  sort(e + 1, e + cnt + 1, cmp2);
  for (int i = 1; i <= cnt; i++) {
    printf("%d %d\n", e[i].u, e[i].v);
  }
  return 0;
}
