#include <bits/stdc++.h>
using namespace std;
struct pers {
  int nr, poz;
};
pers v[101];
bool cmp(pers a, pers b) {
  if (a.nr == b.nr) return a.poz < b.poz;
  return a.nr < b.nr;
}
int sol1[101], sol2[101];
int main() {
  int n, i, st, dr, sol = 0;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> v[i].nr, v[i].poz = i;
  sort(v + 2, v + n + 1, cmp);
  reverse(v + 2, v + n + 1);
  st = dr = 1;
  while (dr < n && v[st].nr > 0) {
    while (v[st].nr > 0 && dr < n) {
      ++dr;
      ++sol;
      sol1[sol] = v[st].poz, sol2[sol] = v[dr].poz;
      --v[st].nr;
    }
    ++st;
  }
  if (dr >= n) {
    cout << sol << '\n';
    for (i = 1; i <= sol; ++i) cout << sol1[i] << " " << sol2[i] << '\n';
  } else
    cout << -1;
  return 0;
}
