#include <bits/stdc++.h>
using namespace std;
namespace io {
const int l = 1 << 20;
char buf[l], *s, *t;
inline char gc() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, l, stdin);
    return s == t ? EOF : *s++;
  }
  return *s++;
}
char c;
template <class IT>
inline void gi(IT &x) {
  x = 0;
  c = gc();
  while (c < '0' || c > '9') c = gc();
  while ('0' <= c && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = gc();
  }
}
};  // namespace io
using io::gi;
template <class IT>
inline void cmin(IT &a, IT b = 0) {
  if (a > b) a = b;
}
template <class IT>
inline void cmax(IT &a, IT b = 0) {
  if (a < b) a = b;
}
template <class IT>
inline IT _min(IT a, IT b = 0) {
  return a > b ? b : a;
}
template <class IT>
inline IT _max(IT a, IT b = 0) {
  return a < b ? b : a;
}
const long long p = 1000000007ll;
const int N = 200005;
struct qwq {
  int a, b;
  inline qwq() {}
  inline bool operator<(const qwq &x) const { return a > x.a; }
} x[N];
int main() {
  int n, i, t, d;
  scanf("%d", &n);
  t = n;
  for (i = 1; i <= n; ++i) scanf("%d", &x[i].a);
  for (i = 1; i <= n; ++i) x[i].b = i << 1;
  sort(x + 1, x + n + 1);
  for (i = 1; i < n; ++i) printf("%d %d\n", x[i].b, x[i + 1].b);
  for (i = 1; i <= n; ++i) {
    if ((d = i + x[i].a - 1) == t) {
      x[++t] = x[i];
      --x[t].b;
    }
    printf("%d %d\n", x[d].b, x[i].b - 1);
  }
  return 0;
}
