#include <bits/stdc++.h>
using namespace std;
int n, b[200005];
pair<int, int> a[200005];
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second > b.second; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &(a[i].second)), a[i].first = i;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) b[i] = a[i].first * 2;
  for (int i = 2; i <= n; i++)
    printf("%d %d\n", a[i - 1].first * 2, a[i].first * 2);
  for (int i = 1; i <= n; i++) {
    int t = i + a[i].second;
    if (!b[t]) b[t] = 2 * a[i].first - 1;
    t--;
    printf("%d %d\n", b[t], 2 * a[i].first - 1);
  }
  return 0;
}
