#include <bits/stdc++.h>
using namespace std;
int n, l, r;
pair<int, int> a[105];
vector<pair<int, int> > vec;
bool cmp(pair<int, int> a, pair<int, int> b) { return a > b; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n, cmp);
  l = 0, r = 1;
  while (a[l].first && r < n) {
    --a[l].first;
    vec.push_back(pair<int, int>(a[l].second + 1, a[r].second + 1));
    ++r;
    if (!a[l].first) ++l;
  }
  if ((int)vec.size() != n - 1)
    puts("-1");
  else {
    printf("%d\n", n - 1);
    for (int i = 0; i < n - 1; ++i)
      printf("%d %d\n", vec[i].first, vec[i].second);
  }
  return 0;
}
