#include <bits/stdc++.h>
using namespace std;
int64_t pow3(int64_t a, int64_t b, int64_t m = 1000000007) {
  int64_t res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
void solve() {
  int64_t n;
  cin >> n;
  int64_t d[n];
  for (int64_t i = 0; i < n; i++) cin >> d[i];
  vector<pair<int64_t, int64_t> > ee, e;
  int64_t lt;
  for (int64_t i = 1; i < n + 1; i++) {
    ee.push_back(make_pair(d[i - 1], 2 * i - 1));
    lt = 2 * i + 1;
  }
  if (n == 1) {
    cout << 1 << " " << 2 << endl;
    return;
  }
  vector<int64_t> seq;
  sort(ee.begin(), ee.end());
  reverse(ee.begin(), ee.end());
  for (int64_t i = 0; i < n - 1; i++)
    e.push_back(make_pair(ee[i].second, ee[i + 1].second));
  for (int64_t i = 0; i < e.size(); i++) seq.push_back(e[i].first);
  seq.push_back(e[e.size() - 1].second);
  for (int64_t i = 0; i < n; i++) {
    e.push_back(make_pair(seq[i + ee[i].first - 1], ee[i].second + 1));
    if (i + ee[i].first == seq.size()) seq.push_back(ee[i].second + 1);
  }
  for (auto i : e) cout << i.first << " " << i.second << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
