#include <bits/stdc++.h>
using namespace std;
ostream& operator<<(ostream& cerr, vector<long long> aux) {
  cerr << "[";
  for (auto e : aux) cerr << e << ' ';
  cerr << "]";
  return cerr;
}
const int maxN = 100011;
int n;
pair<int, int> v[maxN];
vector<pair<int, int> > answer;
vector<int> order;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i].first);
    v[i].second = i + 1;
  }
  sort(v, v + n);
  reverse(v, v + n);
  for (int i = 0; i < n; i++) order.push_back(v[i].second * 2);
  for (int i = 0; i + 1 < n; i++)
    answer.push_back(make_pair(order[i], order[i + 1]));
  for (int i = 0; i < n; i++) {
    int aux = v[i].first - 1;
    answer.push_back(make_pair(v[i].second * 2 - 1, order[i + aux]));
    if (i + aux + 1 == order.size()) order.push_back(v[i].second * 2 - 1);
  }
  for (auto e : answer) printf("%d %d\n", e.first, e.second);
  return 0;
}
