#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main() {
  int n;
  cin >> n;
  pair<int, int> arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    arr[i].second = 2 * i + 1;
  }
  sort(arr, arr + n, comp);
  vector<int> path;
  for (int i = 0; i < n; i++) path.push_back(arr[i].second);
  for (int i = 1; i < n; i++) {
    cout << path[i - 1] << ' ' << path[i] << endl;
  }
  int index;
  for (int i = 0; i < n; i++) {
    index = arr[i].first + i - 1;
    cout << path[index] << ' ' << arr[i].second + 1 << endl;
    if (index == path.size() - 1) path.push_back(arr[i].second + 1);
  }
}
