#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int d[n + 1];
  vector<int> v;
  for (i = 1; i <= n; i++) {
    cin >> d[i];
    v.push_back(i);
  }
  sort(v.begin(), v.end(), [&](int x, int y) { return d[x] > d[y]; });
  for (i = 0; i < v.size(); i++) {
    v[i] = v[i] * 2;
  }
  int p = 2 * n;
  int par[2 * n + 1], g[2 * n + 1];
  for (i = 0; i <= 2 * n; i++) {
    g[i] = -1;
  }
  for (i = 0; i < n; i++) {
    if (d[v[i] / 2] + i >= v.size())
      v.push_back(v[i] - 1);
    else {
      g[v[i] - 1] = v[(i + d[v[i] / 2] - 1)];
    }
  }
  for (i = 1; i <= 2 * n; i++) {
    if (g[i] != -1) {
      cout << i << " " << g[i] << endl;
    }
  }
  for (i = 0; i < v.size() - 1; i++) {
    cout << v[i] << " " << v[i + 1] << endl;
  }
  return 0;
}
