#include <bits/stdc++.h>
using namespace std;
struct stud {
  int id, message;
  bool iknow;
} * group;
void Quick_Sort(stud*, int);
int main() {
  int polycarp, num, summ = 0, counts = 0;
  cin >> num;
  num--;
  cin >> polycarp;
  summ += polycarp;
  group = new stud[num];
  for (int i = 0; i < num; i++) {
    cin >> group[i].message;
    summ += group[i].message;
    group[i].iknow = 0;
    group[i].id = i + 2;
  }
  if (summ < num || polycarp == 0) {
    cout << -1;
    return 0;
  }
  Quick_Sort(group, num);
  cout << num << endl;
  for (int i = 0; polycarp != 0 && i < num; i++) {
    group[i].iknow = 1;
    polycarp--;
    cout << 1 << " " << group[i].id << endl;
  }
  for (int i = 0; i < num; i++) {
    if (group[i].iknow == 1 && i < num - 1 && group[i].message != 0) {
      for (int j = i + 1; group[i].message != 0 && j < num; j++) {
        if (group[j].iknow == 0) {
          group[j].iknow = 1;
          group[i].message--;
          cout << group[i].id << " " << group[j].id << endl;
        }
      }
    }
  }
  return 0;
}
void Quick_Sort(stud* arr, int arr_size) {
  int i = 0, j = arr_size - 1, center;
  stud temp;
  center = arr[arr_size >> 1].message;
  while (i <= j) {
    while (arr[i].message > center) i++;
    while (arr[j].message < center) j--;
    if (i <= j) {
      temp = arr[i];
      arr[i] = arr[j];
      arr[j] = temp;
      i++;
      j--;
    }
  }
  if (j > 0) Quick_Sort(arr, j + 1);
  if (arr_size > i) Quick_Sort(arr + i, arr_size - i);
}
