#include <bits/stdc++.h>
using namespace std;
int a[200], u[200];
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main() {
  int n;
  cin >> n;
  int s = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s + 1 < n || !a[0]) {
    cout << -1;
    return 0;
  }
  int kn = 1;
  u[0] = 1;
  vector<pair<int, int> > ans;
  while (1) {
    if (kn == n) break;
    int ps = -1;
    for (int i = 0; i < n; i++) {
      if (u[i] && a[i]) ps = i;
    }
    int to = -1;
    for (int i = 0; i < n; i++)
      if (!u[i] && a[i]) to = i;
    if (to != -1) {
      u[to]++;
      a[ps]--;
      kn++;
      ans.push_back(make_pair(ps, to));
      continue;
    }
    for (int i = 0; i < n; i++) {
      if (!u[i]) {
        u[i] = 1;
        a[ps]--;
        kn++;
        ans.push_back(make_pair(ps, i));
        break;
      }
    }
  }
  cout << (int)ans.size() << "\n";
  for (int i = 0; i < (int)ans.size(); i++) {
    cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << "\n";
  }
  return 0;
}
