#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
pair<int, int> a[N];
int o[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, m;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i - 1].first;
    a[i - 1].second = i * 2 - 1;
  }
  sort(a, a + n);
  m = n;
  for (i = n - 1; i >= 0; i--) {
    o[n - i] = a[i].second;
    if (i) cout << a[i].second << " " << a[i - 1].second << '\n';
  }
  for (i = n - 1; i >= 0; i--) {
    cout << a[i].second + 1 << " " << o[a[i].first + n - i - 1] << '\n';
    if (a[i].first + n - i - 1 == m) o[++m] = a[i].second + 1;
  }
}
