#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int chkmin(T &x, const T &y) {
  return x > y ? x = y, 1 : 0;
}
template <typename T>
inline int chkmax(T &x, const T &y) {
  return x < y ? x = y, 1 : 0;
}
template <typename T>
inline T read(T &f) {
  f = 0;
  int x = 1;
  char c = getchar();
  while (!isdigit(c)) x = c == '-' ? -1 : 1, c = getchar();
  while (isdigit(c)) (f *= 10) += c & 15, c = getchar();
  return f *= x;
}
using int64 = long long;
using uint64 = unsigned long long;
const int N = 200000 + 5;
int n, d[N], p[N], v[N];
void addedge(int u, int v) { printf("%d %d\n", u, v); }
int main() {
  read(n);
  for (int i = (1), ___ = (n); i <= ___; ++i) p[i] = i, read(d[i]);
  sort(p + 1, p + 1 + n, [&](int x, int y) { return d[x] > d[y]; });
  int c = n;
  for (int i = (1), ___ = (n); i <= ___; ++i) {
    v[i] = 2 * p[i] - 1;
    if (i > 1) addedge(v[i - 1], v[i]);
  }
  for (int i = (1), ___ = (n); i <= ___; ++i) {
    int t = d[p[i]];
    if (i + t > c) {
      v[++c] = 2 * p[i];
      addedge(v[c - 1], v[c]);
    } else
      addedge(2 * p[i], v[i + t - 1]);
  }
  return 0;
}
