#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
struct req {
  int i, d;
  req() {}
  req(int i, int d) : i(i), d(d) {}
  bool operator<(const req &r) const { return d > r.d; }
};
req ord[maxn];
int id[maxn * 2];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int d;
    scanf("%d", &d);
    ord[i] = req(i, d);
  }
  sort(ord + 1, ord + 1 + n);
  int len = ord[1].d;
  for (int i = 1; i <= ord[1].d; i++) {
    id[i] = 2 * ord[i].i;
    if (i > 1) printf("%d %d\n", id[i], id[i - 1]);
  }
  for (int i = 1; i <= ord[1].d; i++) {
    printf("%d %d\n", id[ord[i].d + i - 1], 2 * ord[i].i - 1);
    if (ord[i].d + i > len) id[++len] = 2 * ord[i].i - 1;
  }
  for (int i = ord[1].d + 1; i <= n; i++) {
    if (ord[i].d == 1) {
      printf("%d %d\n", 2 * ord[i].i, id[1]);
      printf("%d %d\n", 2 * ord[i].i, 2 * ord[i].i - 1);
    } else {
      printf("%d %d\n", 2 * ord[i].i, id[1]);
      printf("%d %d\n", 2 * ord[i].i - 1, id[ord[i].d - 1]);
    }
  }
  return 0;
}
