#include <bits/stdc++.h>
using namespace std;
int ar[111];
int in[111];
long long n, s, now, t;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    s += ar[i];
    in[i] = i;
  }
  if (s < n - 1 || ar[0] == 0) {
    cout << -1;
    return 0;
  }
  for (int ii = 1; ii < n - 1; ii++)
    for (int i = 1; i < n - 1; i++)
      if (ar[in[i]] < ar[in[i + 1]]) swap(in[i], in[i + 1]);
  cout << n - 1;
  s = 0;
  now = 1;
  while (now < n) {
    while (ar[in[s]] > 0 && now < n) {
      cout << endl << in[s] + 1 << " " << in[now++] + 1;
      ar[in[s]]--;
    }
    s++;
  }
  return 0;
}
