#include <bits/stdc++.h>
const int MAX_N = 2e5 + 7;
std::vector<int> wires;
std::vector<int> indices;
std::vector<std::vector<int>> Graph;
std::vector<int> answer;
int N;
int main() {
  scanf("%d", &N);
  wires.resize(N);
  indices.resize(N);
  answer.resize(N);
  Graph.resize(2 * N + 2);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &wires[i]);
    indices[i] = i;
  }
  sort(indices.begin(), indices.end(),
       [](int a, int b) -> bool { return wires[a] > wires[b]; });
  std::transform(indices.begin(), indices.end(), answer.begin(),
                 [](int i) -> int { return 2 * (i + 1); });
  for (auto i = 0; i < N; ++i) {
    int currentD = wires[indices[i]];
    int nodeToAddTo = i + currentD - 1;
    if (nodeToAddTo + 1 == answer.size()) {
      answer.push_back(2 * indices[i] + 1);
    } else {
      Graph[answer[nodeToAddTo]].push_back(2 * indices[i] + 1);
    }
  }
  for (int i = 1; i < answer.size(); ++i) {
    printf("%d %d\n", answer[i - 1], answer[i]);
  }
  for (int i : answer) {
    for (int j : Graph[i]) {
      printf("%d %d\n", i, j);
    }
  }
  return 0;
}
