#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k;
  cin >> k;
  vector<pair<int, int> > v, ans;
  for (int i = 1; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  sort((v).begin(), (v).end());
  reverse((v).begin(), (v).end());
  vector<pair<int, int> > last, next;
  last.push_back(make_pair(k, 0));
  int cur = 0;
  while (true) {
    for (int i = 0; i < last.size(); i++) {
      for (int j = 0; j < last[i].first; j++) {
        if (cur < v.size()) {
          ans.push_back(make_pair(last[i].second, v[cur].second));
          next.push_back(v[cur]);
          cur++;
        }
      }
    }
    if (cur >= v.size()) break;
    if (next.size() == 0) {
      cout << -1;
      return 0;
    }
    last = next;
    next.clear();
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first + 1 << " " << ans[i].second + 1 << "\n";
  }
  return 0;
}
