#include <bits/stdc++.h>
using namespace std;
struct st {
  int msg;
  int id;
};
bool compare(st x, st y) { return (x.msg > y.msg); }
int main() {
  int n;
  scanf("%d", &n);
  st a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].msg);
    a[i].id = i;
  }
  sort(a + 1, a + n, compare);
  int j = 0, i;
  for (i = 0; i < n; i++) {
    if (i > j) break;
    j += a[i].msg;
    if (j >= n) {
      break;
    }
  }
  if (j < n - 1) {
    printf("-1");
  } else {
    vector<pair<int, int> > arr;
    j = 1;
    for (i = 0; i < n; i++) {
      if (j >= n) break;
      while (j < n && a[i].msg--) {
        arr.push_back(make_pair(a[i].id + 1, a[j].id + 1));
        j++;
      }
    }
    printf("%d\n", arr.size());
    for (int k = 0; k < arr.size(); k++) {
      printf("%d %d\n", arr[k].first, arr[k].second);
    }
  }
  return 0;
}
