#include <bits/stdc++.h>
using namespace std;
int n, j = 1, sum, o;
bool w[1000];
int main() {
  w[0] = 1;
  cin >> n;
  vector<pair<int, int> > a(n), ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    sum += a[i].first;
  }
  if (a[0].first == 0 || sum < n - 1) {
    cout << -1;
    return 0;
  }
  sort(a.begin() + 1, a.end());
  reverse(a.begin() + 1, a.end());
  for (int i = 0; i < n; i++) {
    while (a[i].first != 0 && w[a[i].second] == 1) {
      if (w[a[j].second] == 0) {
        w[a[j].second] = 1;
        a[i].first--;
        ans.push_back(make_pair(a[i].second + 1, a[j].second + 1));
      }
      j++;
      if (j == n) {
        o = 1;
        break;
      }
    }
    if (o == 1) break;
  }
  if (j != n) {
    cout << -1;
  } else {
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << endl;
    }
  }
  return 0;
}
