#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  for (long long i = 0; i < (long long)(n); ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin() + 1, a.end());
  reverse(a.begin() + 1, a.end());
  vector<pair<long long, long long> > ans;
  long long i = 0, j = 1;
  if (a[0].first == 0) {
    cout << -1;
    return 0;
  }
  while (j < n) {
    while (i < n && a[i].first == 0) {
      i++;
    }
    if (i == n) break;
    ans.push_back({a[i].second, a[j].second});
    a[i].first--;
    j++;
  }
  if ((long long)(ans).size() < n - 1) {
    cout << -1;
  } else {
    cout << (long long)(ans).size() << endl;
    for (auto i : ans) {
      cout << i.first + 1 << ' ' << i.second + 1 << endl;
    }
  }
  return 0;
}
