#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, id[N], q[N * 2], a[N], top;
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d", &n);
  top = n;
  for (int i = (int)(1); i <= (int)(n); i++) scanf("%d", &a[i]), id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = (int)(1); i <= (int)(n); i++) q[i] = id[i] * 2;
  for (int i = (int)(1); i <= (int)(n - 1); i++)
    printf("%d %d\n", q[i], q[i + 1]);
  for (int i = (int)(1); i <= (int)(n); i++) {
    int v = a[id[i]];
    printf("%d %d\n", q[i + v - 1], id[i] * 2 - 1);
    if (i + v > top) q[++top] = id[i] * 2 - 1;
  }
}
