#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
using namespace std;
ifstream inp("inp.txt");
ofstream out("out.txt");
const int N = 1e5 + 5;
const long long B = 73;
int builtin_popcount(int &mask) {
  int kol = 0;
  for (int bit = 0; bit < 32; bit++) kol += int(bool(mask & (1 << bit)));
  return kol;
}
int builtin_popcountll(long long &mask) {
  int kol = 0;
  for (long long bit = 0; bit < 62; bit++)
    kol += int(bool(mask & (1LL << bit)));
  return kol;
}
signed main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int>> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i].first;
    d[i].second = (i + 1);
  }
  vector<pair<int, int>> ans;
  vector<int> h;
  sort(d.rbegin(), d.rend());
  for (int i = 0; i < n - 1; i++)
    ans.push_back({d[i].second * 2 - 1, d[i + 1].second * 2 - 1});
  int tlen = n;
  bool can = false;
  for (int i = 0; i < n; i++) {
    int pos = i + d[i].first - 1;
    if (pos >= tlen) {
      pos = i - d[i].first + 1;
      if (pos < 0) {
        pos = abs(pos);
        pos--;
        ans.push_back({h[pos], d[i].second * 2});
        if (((int)h.size()) - 1 == pos) h.push_back(d[i].second * 2);
      } else {
        ans.push_back({d[i].second * 2, d[pos].second * 2 - 1});
      }
      continue;
    }
    if (pos >= n)
      ans.push_back({d[i].second * 2, d[pos].second * 2});
    else
      ans.push_back({d[i].second * 2, d[pos].second * 2 - 1});
    if (pos == tlen - 1) {
      auto y = d[i];
      d.push_back(y);
      tlen++;
    }
    if (pos == 0 && !can) {
      h.push_back(d[i].second * 2);
      can = true;
    }
  }
  for (auto el : ans) cout << el.first << ' ' << el.second << endl;
  return 0;
}
