#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n;
  vector<bool> u(n, 0);
  u[0] = 1;
  vector<pair<int, int> > vp(n);
  vector<int> org(n);
  for (int i = 0; i < n; i++) {
    cin >> a;
    org[i] = a;
    vp[i] = make_pair(a, i);
  }
  sort(vp.rbegin(), vp.rend());
  int fifo[101], p = 0, k = 1;
  string ans = "";
  int sum = 0;
  fifo[p] = 0;
  int v;
  while (p != k) {
    v = fifo[p++];
    for (int i = 0; i < n && org[v]; i++) {
      if (!u[vp[i].second]) {
        sum++;
        u[vp[i].second] = 1;
        org[v]--;
        fifo[k++] = vp[i].second;
        ans += to_string(v + 1) + " " + to_string(vp[i].second + 1) + "\n";
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!u[i]) {
      cout << "-1";
      return 0;
    }
  }
  cout << sum << endl;
  cout << ans;
  return 0;
}
