#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> pupils;
  int message = 0;
  multimap<int, int, greater<int>> sociable;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    message += x;
    if (i) {
      sociable.insert({x, i + 1});
    }
    pupils.push_back(x);
  }
  if (message < n - 1 || pupils[0] == 0) {
    cout << -1 << endl;
  } else {
    vector<pair<int, int>> ms;
    auto from = sociable.begin();
    auto to = sociable.begin();
    int y = pupils[0];
    while (to != sociable.end() && y--) {
      ms.push_back({1, to->second});
      to++;
    }
    while (to != sociable.end()) {
      int x = from->first;
      while (to != sociable.end() && x--) {
        ms.push_back({from->second, to->second});
        to++;
      }
      from++;
    }
    cout << ms.size() << endl;
    for (auto s : ms) {
      cout << s.first << " " << s.second << endl;
    }
  }
}
