#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int policarp;
  cin >> policarp;
  if (policarp == 0) {
    cout << -1;
    return 0;
  }
  vector<pair<char, char> > otherPeople(n - 1);
  int k = policarp;
  for (int i = 0; i < n - 1; i++) {
    int tmp;
    cin >> tmp;
    otherPeople[i] = make_pair(tmp, i + 2);
    k += tmp;
  }
  if (k < n - 1) {
    cout << -1;
    return 0;
  }
  sort(otherPeople.rbegin(), otherPeople.rend());
  otherPeople.push_back(make_pair(policarp, 1));
  cout << n - 1 << '\n';
  queue<int> q;
  q.push(n - 1);
  int i = 0;
  while (!q.empty()) {
    int tmp = q.front();
    q.pop();
    while ((otherPeople[tmp].first-- > 0) && (i < n - 1)) {
      q.push(i);
      cout << int(otherPeople[tmp].second) << " "
           << int(otherPeople[i++].second) << endl;
    }
  }
  return 0;
}
