#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
vector<int> g[N];
vector<pair<int, int> > readInp() {
  iostream::sync_with_stdio(false);
  cin >> n;
  vector<pair<int, int> > v(n);
  v.reserve(2 * n);
  for (int i = 0; i < n; i++) cin >> v[i].first, v[i].second = 2 * i + 1;
  sort(v.begin(), v.end(), greater<pair<int, int> >());
  for (int i = 0; i < n - 1; i++) g[v[i].second].push_back(v[i + 1].second);
  return v;
}
int main() {
  auto v = readInp();
  for (int i = 0; i < n; i++) {
    int j = i + v[i].first - 1;
    g[v[j].second].push_back(v[i].second + 1);
    if (j == (int)v.size() - 1) v.push_back({0, v[i].second + 1});
  }
  for (int u = 1; u <= 2 * n; u++)
    for (int v : g[u]) cout << u << ' ' << v << '\n';
}
