#include <bits/stdc++.h>
using namespace std;
vector<int> V[200005];
int n, dis[200005], idx[200005];
int plc[200005];
bool cmp(int a, int b) { return dis[a] > dis[b]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &dis[i]);
    idx[i] = i;
  }
  sort(idx + 1, idx + n + 1, cmp);
  plc[1] = idx[1] * 2 - 1;
  int lst = dis[idx[1]] + 1;
  plc[lst] = idx[1] * 2;
  int i;
  for (i = 2;; i++) {
    if (plc[i]) break;
    plc[i] = idx[i] * 2 - 1;
    if (i + dis[idx[i]] <= lst)
      V[i + dis[idx[i]] - 1].push_back(idx[i] * 2);
    else
      plc[++lst] = idx[i] * 2;
  }
  for (; i <= n; i++) {
    plc[++lst] = idx[i] * 2 - 1;
    V[lst - dis[idx[i]] + 1].push_back(idx[i] * 2);
  }
  for (int i = 1; i <= lst; i++) {
    if (i < lst) printf("%d %d\n", plc[i], plc[i + 1]);
    int t = V[i].size();
    for (int j = 0; j < t; j++) printf("%d %d\n", plc[i], V[i][j]);
  }
}
