#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
struct Point {
  int len, id;
} p[2 * N];
bool cmp(Point x, Point y) { return x.len > y.len; }
vector<pair<int, int>> res;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].len;
    p[i].id = 2 * i - 1;
  }
  sort(p + 1, p + 1 + n, cmp);
  for (int i = 2; i <= n; i++) {
    res.push_back(make_pair(p[i - 1].id, p[i].id));
  }
  int mx = n;
  for (int i = 1; i <= n; i++) {
    int t = i + p[i].len - 1;
    if (t == mx) {
      mx++;
      p[mx].id = p[i].id + 1;
      res.push_back(make_pair(p[mx - 1].id, p[mx].id));
    } else {
      res.push_back(make_pair(p[t].id, p[i].id + 1));
    }
  }
  for (auto u : res) {
    cout << u.first << ' ' << u.second << endl;
  }
  return 0;
}
