#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, tot = 0, sw;
  vector<long long int> a, b, c;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    a.push_back(m);
    tot += m;
    b.push_back(i);
    c.push_back(0);
  }
  if (a[0] == 0 || tot < n - 1)
    cout << -1 << endl;
  else {
    for (i = 1; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (a[i] < a[j]) {
          sw = a[i];
          a[i] = a[j];
          a[j] = sw;
          sw = b[i];
          b[i] = b[j];
          b[j] = sw;
        }
      }
    }
    cout << n - 1 << endl;
    c[0] = 1;
    for (i = 0; i < n; i++) {
      if (c[i] == 0) {
        for (j = 0; j < n; j++) {
          if (a[j] > 0 && c[j] == 1) {
            cout << b[j] + 1 << " " << b[i] + 1 << endl;
            c[i] = 1;
            a[j]--;
            break;
          }
        }
      }
    }
  }
  return 0;
}
