#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, maxn = 100007, MOD = 1e9 + 7;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long P = 19260817;
int a[maxn << 1];
vector<int> G[maxn << 1];
int n;
int cnt;
struct node {
  int i, dis;
  friend bool operator<(const node &a, const node &b) { return a.dis > b.dis; }
} p[maxn];
int main() {
  scanf("%d", &n);
  int cnt = n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i].dis);
    p[i].i = i;
  }
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; i++) {
    a[i] = 2 * p[i].i;
    int rt = i + p[i].dis - 1;
    if (rt == cnt)
      a[cnt + 1] = a[i] - 1, cnt++;
    else
      G[rt].push_back(a[i] - 1);
  }
  for (int i = 1; i <= cnt; i++) {
    if (i != cnt) printf("%d %d\n", a[i], a[i + 1]);
    for (int j = 0; j < G[i].size(); j++) {
      printf("%d %d\n", a[i], G[i][j]);
    }
  }
  return 0;
}
