#include <bits/stdc++.h>
using namespace std;
int N, sol, dist[200005], arr[200005], k = 5, K;
struct dos {
  int dist, a, b;
} D[200005];
bool comp(const dos &h, const dos &k) { return h.dist > k.dist; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 1; i <= N; i++)
    cin >> D[i].dist, D[i].a = 2 * i - 1, D[i].b = 2 * i;
  sort(D + 1, D + 1 + N, comp);
  for (int i = 1; i <= N; i++) arr[i] = D[i].a, dist[i] = D[i].dist;
  for (int i = 1; i < N; i++) cout << arr[i] << " " << arr[i + 1] << '\n';
  for (int i = 1; i <= N; i++) {
    int a = arr[i], d = dist[i];
    if (i + d - 1 <= N + K) cout << arr[i + d - 1] << " " << a + 1;
    if (i + d - 1 == N + K) arr[N + K + 1] = a + 1, K++;
    cout << "\n";
  }
}
