#include <bits/stdc++.h>
using namespace std;
char _;
long long i, j, k, a, b, c, d, f, g, h, l, m, n, p, q, r, s, t, u, v, w, x, y,
    z, maxx = INT_MIN, minn = INT_MAX, ans = 0, sum = 0, cnt = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n;
  int A[n];
  for (i = 0; i < n; i++) {
    cin >> A[i];
    sum += A[i];
  }
  if (sum < n - 1 || A[0] == 0) {
    cout << -1 << endl;
    return 0;
  }
  cout << n - 1 << endl;
  j = 1;
  k = 1;
  for (i = 0; i < n; i++) {
    m = 0;
    if (cnt == 0) {
      while (j < n && m < A[i]) {
        if (A[j] != 0) {
          cout << i + 1 << " " << j + 1 << endl;
          m++;
        }
        j++;
      }
      if (j == n) {
        cnt = 1;
      }
    }
    if (cnt == 1 && m < A[i]) {
      while (k < n && m < A[i]) {
        if (A[k] == 0) {
          cout << i + 1 << " " << k + 1 << endl;
          m++;
        }
        k++;
      }
    }
  }
  return 0;
}
