#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n;
struct NO {
  int num, dist;
  bool operator<(const NO& other) const { return dist > other.dist; }
} arr[MAXN];
vector<int> v[MAXN];
int main() {
  cin >> n;
  for (int i = 1, d; i <= n; i++) {
    cin >> d;
    arr[i].dist = d;
    arr[i].num = 2 * i - 1;
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n - 1; i += 1) v[arr[i].num].push_back(arr[i + 1].num);
  int tail = n;
  for (int i = 1; i <= n; i += 1) {
    if (arr[i].dist > tail - i) {
      v[arr[tail].num].push_back(arr[i].num + 1);
      arr[++tail].num = arr[i].num + 1;
    } else {
      int branch = arr[i + arr[i].dist - 1].num;
      v[branch].push_back(arr[i].num + 1);
    }
  }
  for (int i = 1; i <= 2 * n; i += 1) {
    for (int j = 0; j < v[i].size(); j++) {
      cout << i << " " << v[i][j] << endl;
    }
  }
  return 0;
}
