#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int t[N];
struct Node {
  int u, v, w;
  bool operator<(const Node &W) const { return w > W.w; }
} a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].w;
    a[i].u = 2 * i - 1;
    a[i].v = 2 * i;
  }
  vector<pair<int, int> > ans;
  sort(a + 1, a + 1 + n);
  for (int i = 1; i < n; i++) {
    ans.push_back(make_pair(a[i].u, a[i + 1].u));
    t[i] = a[i].u;
  }
  t[n] = a[n].u;
  int cnt = n;
  for (int i = 1; i <= n; i++) {
    if (a[i].w == cnt - i + 1) {
      ans.push_back(make_pair(t[cnt], a[i].v));
      t[++cnt] = a[i].v;
    } else {
      ans.push_back(make_pair(t[i + a[i].w - 1], a[i].v));
    }
  }
  for (auto x : ans) cout << x.first << " " << x.second << endl;
  return 0;
}
