#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int buf;
  vector<double> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> buf;
    a.push_back(buf);
  }
  if (a[0] == 0) {
    cout << -1;
    return 0;
  }
  if (accumulate(a.begin(), a.end(), 0.0) < n - 1) {
    cout << -1;
    return 0;
  }
  vector<double> inform(n, 0.0);
  inform[0] = 1;
  cout << n - 1 << endl;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if ((inform[j] == 0) && (a[j] != 0) && (a[i] != 0)) {
        cout << i + 1 << " "
             << " " << j + 1 << endl;
        inform[j] = 1;
        a[i]--;
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if ((inform[j] == 0) && (a[i] != 0)) {
        cout << i + 1 << " "
             << " " << j + 1 << endl;
        inform[j] = 1;
        a[i]--;
      }
    }
  return 0;
}
