#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  int arrNum[n];
  for (int i = 0; i < n; i++) {
    cin >> arrNum[i];
    sum += arrNum[i];
  }
  if (sum < n - 1 || arrNum[0] == 0) {
    cout << -1 << endl;
    return 0;
  }
  bool used[n];
  for (int i = 0; i < n; i++) used[i] = false;
  used[0] = true;
  cout << n - 1 << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; (j < n) && arrNum[i] > 0; j++) {
      if (arrNum[j] > 0 && !used[j]) {
        arrNum[i]--;
        cout << i + 1 << ' ' << j + 1 << endl;
        used[j] = true;
      }
    }
    if (arrNum[i] > 0) {
      for (int j = 0; (j < n) && arrNum[i] > 0; j++) {
        if (arrNum[j] == 0 && !used[j]) {
          arrNum[i]--;
          cout << i + 1 << ' ' << j + 1 << endl;
          used[j] = true;
        }
      }
      arrNum[i] = -1;
    }
  }
  return 0;
}
