#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> A(n + 1);
  for (int i = 0; i < n; i++) cin >> A[i + 1];
  vector<pair<int, int> > ans;
  vector<int> rees;
  for (int i = 1; i <= n; i++) rees.push_back(2 * i);
  sort(rees.begin(), rees.end(),
       [&](int u, int v) { return A[u / 2] > A[v / 2]; });
  for (int i = 0; i < n; i++) {
    int want = i + A[rees[i] / 2] - 1;
    if (want >= rees.size() - 1) {
      rees.push_back(rees[i] - 1);
    } else {
      ans.emplace_back(rees[want], rees[i] - 1);
    }
  }
  for (int i = 0; i + 1 < rees.size(); i++)
    ans.emplace_back(rees[i], rees[i + 1]);
  for (auto& v : ans) cout << v.first << ' ' << v.second << '\n';
  return 0;
}
