#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int sz = 200;
vector<int> parent;
void initialize() {}
void test_case() {
  int n;
  cin >> n;
  vector<array<int, 2>> q(n);
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    q[i - 1] = {x, i};
  }
  sort(q.rbegin(), q.rend());
  vector<int> arr;
  for (int i = 0; i < q.size() - 1; i++) {
    cout << 2 * q[i][1] << ' ' << 2 * q[i + 1][1] << '\n';
    arr.push_back(2 * q[i][1]);
  }
  arr.push_back(2 * q.back()[1]);
  for (int i = 0; i < n; i++) {
    cout << 2 * q[i][1] - 1 << ' ' << arr[i + q[i][0] - 1] << '\n';
    if (i + q[i][0] == arr.size()) {
      arr.push_back(2 * q[i][1] - 1);
    }
  }
}
int main() {
  initialize();
  int t;
  t = 1;
  while (t--) {
    test_case();
  }
}
