#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T a) {
  return a * a;
}
int n, p;
vector<pair<int, int> > a;
vector<char> was;
vector<pair<int, int> > ans;
int main() {
  srand(time(0));
  scanf("%d%d", &n, &p);
  a.resize(n - 1);
  was.resize(n, 0);
  for (int i = 1; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[i - 1] = make_pair(x, i + 1);
  }
  if (p == 0) {
    puts("-1");
    return 0;
  }
  sort(a.begin(), a.end());
  a.push_back(make_pair(p, 1));
  reverse(a.begin(), a.end());
  was[0] = 1;
  ans.clear();
  for (int i = 0; i < n; i++) {
    if (!was[i]) {
      puts("-1");
      return 0;
    }
    for (int j = i + 1; j < n; j++) {
      if (a[i].first == 0) {
        break;
      }
      if (was[j]) {
        continue;
      }
      was[j] = 1;
      a[i].first--;
      ans.push_back(make_pair(a[i].second, a[j].second));
    }
  }
  char check = 1;
  for (int i = 0; i < n; i++) {
    if (!was[i]) {
      check = 0;
      break;
    }
  }
  if (!check) {
    puts("-1");
    return 0;
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
