#include <bits/stdc++.h>
using namespace std;
int n, m, q, k;
int d[300005], p[300005];
int stk[300005], tp;
int ww[300005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n); ++i) scanf("%d", d + i), p[i] = i;
  sort(p + 1, p + n + 1, [](int i, int j) { return d[i] > d[j]; });
  for (int i = 1; i <= (n); ++i) stk[i] = 2 * p[i];
  tp = n;
  for (int i = 2; i <= (n); ++i) printf("%d %d\n", stk[i - 1], stk[i]);
  for (int i = 1; i <= (n); ++i)
    if (d[p[i]] > tp - i)
      stk[++tp] = 2 * p[i] - 1, printf("%d %d\n", stk[tp - 1], stk[tp]);
    else
      printf("%d %d\n", stk[i + d[p[i]] - 1], 2 * p[i] - 1);
  return 0;
}
