#include <bits/stdc++.h>
using namespace std;
void display(vector<pair<long long, long long>>& v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  cout << endl;
}
int32_t main() {
  long long n;
  cin >> n;
  ;
  long long a[n];
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i != 0) {
      v.push_back({a[i], i});
    }
  }
  sort(v.begin(), v.end());
  if (a[0] == 0) {
    cout << -1 << endl;
  } else {
    vector<pair<long long, long long>> res;
    map<long long, long long> sent;
    for (long long i = (v.size() - 1); i >= 0; i--) {
      if (a[0] > 0) {
        if (sent[v[i].second] == 0) {
          sent[v[i].second] = 1;
          res.push_back({1, v[i].second + 1});
          a[0]--;
        }
      }
    }
    if (sent.size() != (n - 1)) {
      for (long long i = (v.size() - 1); i >= 0; i--) {
        if (v[i].first > 0) {
          for (long long j = (v.size() - 1); j >= 0; j--) {
            if (v[i].first > 0) {
              if (i != j && sent[v[j].second] == 0) {
                sent[v[j].second] = 1;
                res.push_back({v[i].second + 1, v[j].second + 1});
                v[i].first--;
              }
            } else {
              break;
            }
          }
        }
        if (sent.size() == (n - 1)) {
          break;
        }
      }
    }
    if (sent.size() == (n - 1)) {
      cout << res.size() << endl;
      display(res);
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
