#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > v;
int32_t main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int d;
    scanf("%d", &d);
    v.push_back({d, i * 2});
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (int sz = v.size(), i = 0; i < sz; i++)
    if (v[i].first + i >= v.size())
      v.push_back({0, v[i].second - 1});
    else
      printf("%d %d\n", v[v[i].first + i - 1].second, v[i].second - 1);
  for (int i = 0; i < v.size() - 1; i++)
    printf("%d %d\n", v[i].second, v[i + 1].second);
  return 0;
}
