#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7, MOD = 1e9 + 7;
pair<int, int> p[MAXN];
int n, h[MAXN], id[2 * MAXN];
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> p[i].first, p[i].second = i;
  sort(p + 1, p + 1 + n, greater<pair<int, int> >());
  h[1] = 1, id[1] = 2 * p[1].second - 1;
  for (int i = 2; i <= n; ++i)
    h[i] = i, id[i] = 2 * p[i].second - 1,
    ans.push_back({2 * p[i].second - 1, 2 * p[i - 1].second - 1});
  for (int i = 1; i <= n; ++i) {
    int nxt = id[h[i] + p[i].first - 1];
    ans.push_back({nxt, 2 * p[i].second});
    if (id[h[i] + p[i].first] == 0) id[h[i] + p[i].first] = 2 * p[i].second;
  }
  for (auto v : ans) cout << v.first << ' ' << v.second << '\n';
}
