#include <bits/stdc++.h>
using namespace std;
void fast_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const long long MAXN = 1e5 + 228;
long long d[MAXN];
vector<long long> way;
vector<pair<long long, long long>> edges;
bool cmp(long long v, long long u) { return d[v / 2] > d[u / 2]; }
signed main() {
  fast_io();
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> d[i];
  }
  for (long long i = 1; i <= 2 * n - 1; i += 2) {
    way.emplace_back(i);
  }
  sort(way.begin(), way.end(), cmp);
  for (long long i = 1; i < (long long)(way.size()); i++) {
    edges.emplace_back(make_pair(way[i - 1], way[i]));
  }
  for (long long i = 0; i < n; i++) {
    if (i + d[way[i] / 2] == (long long)(way.size())) {
      edges.emplace_back(make_pair(way.back(), way[i] + 1));
      way.emplace_back(way[i] + 1);
    } else {
      edges.emplace_back(make_pair(way[i + d[way[i] / 2] - 1], way[i] + 1));
    }
  }
  for (auto p : edges) {
    cout << p.first << ' ' << p.second << '\n';
  }
  return 0;
}
