#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> D(N);
  for (int i = 0; i < (N); i++) cin >> D[i];
  vector<int> ord(N);
  for (int i = 0; i < (N); i++) ord[i] = i;
  sort(ord.begin(), ord.end(), [&](int i, int j) { return D[i] > D[j]; });
  int len = D[ord[0]];
  vector<int> seq(len + 1);
  vector<vector<int>> uni(len + 1);
  seq[0] = ord[0] * 2 + 1;
  seq[len] = ord[0] * 2 + 2;
  for (int i = 1; i < len; i++) {
    int k = ord[i];
    seq[i] = k * 2 + 1;
    if (i + D[k] >= seq.size()) {
      seq.push_back(k * 2 + 2);
      uni.emplace_back();
    } else {
      uni[i + D[k] - 1].push_back(k * 2 + 2);
    }
  }
  for (int i = len; i < N; i++) {
    int k = ord[i];
    if (D[k] == 1) {
      seq.push_back(k * 2 + 1);
      seq.push_back(k * 2 + 2);
      uni.emplace_back();
      uni.emplace_back();
    } else {
      uni[0].emplace_back(k * 2 + 1);
      uni[D[k] - 2].emplace_back(k * 2 + 2);
    }
  }
  for (int i = 0; i + 1 < seq.size(); i++) {
    cout << seq[i] << ' ' << seq[i + 1] << '\n';
  }
  for (int i = 0; i < seq.size(); i++) {
    for (int j : uni[i]) {
      cout << seq[i] << ' ' << j << '\n';
    }
  }
}
