#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  int f = 1;
  x = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  x *= f;
}
int n, dd[1000005], id[1000005], f[1000005], tot;
pair<int, int> d[1000005];
int main() {
  read(n);
  for (int i = 1; i <= n; ++i)
    read(dd[i]), d[i].second = 2 * i - 1, d[i].first = dd[i];
  sort(d + 1, d + n + 1);
  reverse(d + 1, d + n + 1);
  tot = n;
  for (int i = 1; i <= n; ++i) id[i] = d[i].second;
  for (int i = 1; i < n; ++i) printf("%d %d\n", id[i], id[i + 1]);
  for (int i = 1; i <= n; ++i) {
    int x = i + d[i].first - 1;
    if (x > tot) {
      printf("%d %d\n", id[i] + 1, i - d[i].first + 1);
      continue;
    }
    printf("%d %d\n", d[x].second, id[i] + 1);
    if (x == tot) d[++tot].second = id[i] + 1;
  }
  return 0;
}
