#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
inline void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  x *= f;
}
const int N = 2e5 + 10;
int n;
pair<int, int> a[N];
vector<int> s;
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) {
    read(a[i].first);
    a[i].second = 2 * i - 1;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  s.resize(1);
  for (int i = 1; i <= n; ++i) s.emplace_back(a[i].second);
  for (int i = 1; i <= n - 1; ++i)
    printf("%d %d\n", a[i].second, a[i + 1].second);
  for (int i = 1; i <= n; ++i) {
    int j = i + a[i].first - 1;
    printf("%d %d\n", a[i].second + 1, s[j]);
    if (j == s.size() - 1) s.push_back(a[i].second + 1);
  }
  return 0;
}
