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