#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> d(n), P(n);
  for (int i = 0; i < n; ++i) cin >> d[i], P[i] = i * 2;
  vector<pair<int, int>> ans;
  sort(P.rbegin(), P.rend(), [&](int i, int j) { return d[i / 2] < d[j / 2]; });
  for (int i = 1; i < n; ++i) ans.emplace_back(P[i - 1], P[i]);
  for (int i = 0; i < n; ++i) {
    int dis = d[P[i] / 2];
    if (i + dis - 1 == P.size() or P[i + dis - 1] == P.back()) {
      ans.emplace_back(P.back(), P[i] + 1);
      P.push_back(P[i] + 1);
    } else {
      ans.emplace_back(P[i + dis - 1], P[i] + 1);
    }
  }
  for (auto [a, b] : ans) cout << a + 1 << ' ' << b + 1 << '\n';
}
