#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 10;
struct point {
  int lf, len;
} a[M];
vector<point> v[M];
int n;
bool cmp(point x, point y) { return x.len > y.len; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].len);
    a[i].lf = i * 2 - 1;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    v[i].push_back(a[i]);
  }
  int rt = n;
  for (int i = 1; i <= n; i++) {
    if (i + v[i][0].len <= rt)
      v[i + v[i][0].len - 1].push_back(point{v[i][0].lf + 1, 0});
    else
      v[++rt].push_back(point{v[i][0].lf + 1, 0});
  }
  for (int i = 1; i <= rt; i++) {
    if (i != 1) printf("%d %d\n", v[i - 1][0].lf, v[i][0].lf);
    for (int j = 1; j < v[i].size(); j++)
      printf("%d %d\n", v[i][0].lf, v[i][j].lf);
  }
}
