#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, d[N], a[N], f[N];
int cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), f[i] = i;
  sort(f + 1, f + n + 1, cmp);
  for (int i = 2; i <= n; i++)
    printf("%d %d\n", f[i] * 2 - 1, f[i - 1] * 2 - 1);
  for (int i = 1; i <= n; i++) d[i] = 2 * f[i] - 1;
  for (int i = 1; i <= n; i++) {
    printf("%d %d\n", d[i + a[f[i]] - 1], f[i] * 2);
    if (!d[i + a[f[i]]]) d[i + a[f[i]]] = f[i] * 2;
  }
}
