#include <bits/stdc++.h>
using namespace std;
struct node {
  int id, mess, know;
  bool operator<(const node& x) const {
    if (mess == x.mess) {
      return id < x.id;
    }
    return mess > x.mess;
  }
} a[211];
int main() {
  int n;
  while (cin >> n) {
    int x, sum = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i].mess;
      sum += a[i].mess;
      a[i].id = i;
    }
    if (sum < n - 1 || !a[1].mess) {
      cout << -1 << endl;
      continue;
    }
    cout << n - 1 << endl;
    sort(a + 2, a + 2 + n - 1);
    a[1].know = true;
    for (int i = 1; i <= n && a[i].know && a[i].mess > 0; i++) {
      for (int j = i + 1; j <= n && a[i].mess > 0; j++) {
        if (a[j].know) {
          continue;
        }
        a[j].know = true;
        a[i].mess -= 1;
        cout << a[i].id << " " << a[j].id << endl;
      }
    }
  }
}
