#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 20;
int V[2 * N];
pair<int, int> seq[N];
vector<pair<int, int> > E;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int d;
    cin >> d;
    seq[i].first = d;
    seq[i].second = i;
  }
  sort(seq + 1, seq + n + 1, greater<pair<int, int> >());
  for (int i = 1; i <= n; ++i) {
    V[i] = 2 * seq[i].second - 1;
    if (i != 1) E.push_back({V[i], V[i - 1]});
  }
  int top = n;
  for (int i = 1; i <= n; ++i) {
    int d = seq[i].first;
    E.push_back({V[i] + 1, V[i + d - 1]});
    if (i + d - 1 == top) V[++top] = V[i] + 1;
  }
  for (pair<int, int> e : E) cout << e.first << " " << e.second << endl;
  return 0;
}
