#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 10;
template <typename T>
inline void rd(T &s) {
  s = 0;
  T t = 1, k = getchar();
  for (; k < '0' || k > '9'; k = getchar())
    if (k == '-') t = -1;
  for (; k >= '0' && k <= '9'; k = getchar())
    s = (s << 1) + (s << 3) + (k ^ 48);
  s *= t;
}
int n;
struct IN {
  int v, id;
} p[MAXN];
int cmp(IN a, IN b) { return a.v > b.v; }
int main() {
  rd(n);
  for (int i = 1; i <= n; ++i) rd(p[i].v), p[i].id = i * 2;
  sort(p + 1, p + n + 1, cmp);
  for (int i = 2; i <= n; ++i) printf("%d %d\n", p[i - 1].id, p[i].id);
  int len = n;
  for (int i = 1; i <= n; ++i) {
    int tmp = p[i + p[i].v - 1].id;
    if (tmp == p[len].id) p[++len].id = p[i].id - 1;
    printf("%d %d\n", p[i].id - 1, tmp);
  }
  return 0;
}
