#include <bits/stdc++.h>
using namespace std;
long long n, id[300001], d[300001], iq[300001];
bool cmp(int x, int y) { return d[x] > d[y]; }
bool cmp1(int x, int y) { return x > y; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
    id[i] = i;
    iq[i] = i;
  }
  sort(id + 1, id + 1 + n, cmp);
  sort(iq + 1, iq + 1 + n, cmp);
  sort(d + 1, d + 1 + n, cmp1);
  for (int i = 1; i <= n; i++) id[i] = 2 * id[i] - 1;
  for (int i = 1; i <= n - 1; i++) cout << id[i] << " " << id[i + 1] << endl;
  int k = n;
  for (int i = 1; i <= n; i++) {
    cout << 2 * iq[i] << " " << id[d[i] + i - 1] << endl;
    if (d[i] + i - 1 == k) id[++k] = 2 * iq[i];
  }
}
