#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<pair<long long, long long> > arr(n);
  for (long long i = 0; i < n; i++)
    cin >> arr[i].first, arr[i].second = 2 * i + 1;
  sort(arr.rbegin(), arr.rend());
  vector<pair<long long, long long> > ans;
  for (long long i = 0; i + 1 < n; i++)
    ans.push_back({arr[i].second, arr[i + 1].second});
  long long cnt = 0;
  while (cnt != n) {
    auto res = arr[cnt];
    long long pos = cnt + res.first - 1;
    if (pos == arr.size() - 1) {
      long long val = res.second + 1;
      ans.push_back({arr.back().second, val});
      arr.push_back({0, val});
    } else {
      long long val = res.second + 1;
      ans.push_back({arr[pos].second, val});
    }
    cnt++;
  }
  for (auto x : ans) cout << x.first << " " << x.second << "\n";
  if (ans.size() != 2LL * n - 1) cout << "NO\n";
  return 0;
}
