#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n;
struct point {
  int id, val;
} num[N];
inline int cmp(const point &a, const point &b) { return a.val > b.val; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &num[i].val), num[i].id = i * 2 - 1;
  sort(num + 1, num + n + 1, cmp);
  int tot = n;
  for (int i = 1; i <= n; ++i) {
    if (i != n) printf("%d %d\n", num[i].id, num[i + 1].id);
    if (num[i].val < i)
      printf("%d %d\n", num[i].id + 1, num[i - num[i].val + 1].id);
    else {
      printf("%d %d\n", num[i].id + 1, num[i + num[i].val - 1].id);
      if (num[i].val + i - 1 == tot) num[++tot].id = num[i].id + 1;
    }
  }
}
