#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[105], sum, i, j, c[105], t, b[105];
  while (~scanf("%d", &n)) {
    sum = 0;
    memset(c, 0, sizeof(c));
    memset(b, 0, sizeof(b));
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      c[i] = i;
      sum += a[i];
    }
    if (a[1] == 0 || sum < n - 1) {
      printf("-1\n");
    } else {
      printf("%d\n", n - 1);
      for (i = 2; i <= n; i++) {
        for (j = 2; j <= n - i + 1; j++) {
          if (a[j] < a[j + 1]) {
            t = a[j];
            a[j] = a[j + 1];
            a[j + 1] = t;
            t = c[j];
            c[j] = c[j + 1];
            c[j + 1] = t;
          }
        }
      }
      b[1] = 1;
      int v = 0;
      i = 1;
      while (v != n - 1) {
        for (j = 1; j <= n; j++) {
          if (a[i] > 0 && b[c[i]] == 1 && c[j] != c[i] && b[c[j]] != 1) {
            printf("%d %d\n", c[i], c[j]);
            b[c[j]] = 1;
            a[i]--;
            v++;
            break;
          }
          if (a[i] <= 0) {
            i++;
            break;
          }
        }
      }
    }
  }
  return 0;
}
