#include <bits/stdc++.h>
using namespace std;
int main() {
  queue<pair<int, int> > m;
  int n, u = 0;
  cin >> n;
  vector<int> kek(n), kek_tmp;
  for (int i = 0; i < n; i++) {
    cin >> kek[i];
    u += kek[i];
  }
  kek_tmp = kek;
  if (kek[0] == 0 || u + 1 < n) {
    cout << -1 << endl;
    return 0;
  }
  int j = 0;
  for (int i = 1; i < n; i++) {
    while (j < n && kek_tmp[j] == 0) {
      j++;
    }
    if (kek[i]) {
      kek_tmp[j]--;
      m.push(make_pair(j + 1, i + 1));
    }
  }
  for (int i = 1; i < n; i++) {
    while (j < n && kek_tmp[j] == 0) {
      j++;
    }
    if (!kek[i]) {
      kek_tmp[j]--;
      m.push(make_pair(j + 1, i + 1));
    }
  }
  while (j < n && kek_tmp[j] == 0) {
    j++;
  }
  while (j < n && kek_tmp[j]) {
    kek_tmp[j]--;
    if (j != 0) {
      m.push(make_pair(j + 1, 1));
    } else {
      m.push(make_pair(j + 1, 2));
    }
    while (j < n && kek_tmp[j] == 0) {
      j++;
    }
  }
  cout << m.size() << endl;
  while (m.size()) {
    cout << m.front().first << " " << m.front().second << endl;
    m.pop();
  }
  return 0;
}
