#include <bits/stdc++.h>
using namespace std;
const int mod = 99135583;
int main() {
  vector<pair<int, int> > v;
  int n;
  cin >> n;
  for (int i = 1; i < n + 1; i++) {
    int num;
    cin >> num;
    v.push_back({num, i * 2 - 1});
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  vector<int> link;
  for (auto i : v) {
    link.push_back(i.second + 1);
  }
  for (int i = 1; i < (int)link.size() - 1 + 1; i++) {
    cout << link[i - 1] << ' ' << link[i] << '\n';
  }
  for (int i = 0; i < n; i++) {
    int dif = v[i].first - 1;
    int goal = i + dif;
    cout << v[i].second << ' ' << link[goal] << '\n';
    if (goal == link.size() - 1) {
      link.push_back(v[i].second);
    }
  }
}
