#include <bits/stdc++.h>
void rd(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
void lrd(long long &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int INF = 1e9;
const long long LINF = 1e18;
const int N = 1e5 + 10;
using namespace std;
int n, d[N], id[N], a[N * 2];
bool cmp(int x, int y) { return d[x] > d[y]; }
int main() {
  rd(n);
  for (int i = 1; i <= n; i++) rd(d[i]), id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1; i < n; i++)
    printf("%d %d\n", id[i] * 2 - 1, id[i + 1] * 2 - 1);
  for (int i = 1; i <= n; i++) a[i] = id[i] * 2 - 1;
  for (int i = 1; i <= n; i++) {
    int tmp = d[id[i]] + i - 1;
    if (!a[tmp + 1])
      a[tmp + 1] = id[i] * 2, printf("%d %d\n", a[tmp], a[tmp + 1]);
    else
      printf("%d %d\n", id[i] * 2, a[tmp]);
  }
  return 0;
}
