#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a((size_t)n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.rbegin(), a.rend());
  vector<long long> b((size_t)n);
  for (long long i = 0; i < n; i++) {
    b[i] = a[i].second * 2;
    if (i >= 1) {
      cout << b[i - 1] + 1 << " " << b[i] + 1 << "\n";
    }
  }
  for (long long i = 0; i < n; i++) {
    cout << a[i].second * 2 + 1 + 1 << " " << b[i + a[i].first - 1] + 1 << "\n";
    if (i + a[i].first - 1 == (long long)b.size() - 1) {
      b.push_back(a[i].second * 2 + 1);
    }
  }
  return 0;
}
