#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::pair;
using std::vector;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> students(n);
  int number = 1;
  for (auto& student : students) {
    cin >> student.first;
    student.second = number;
    ++number;
  }
  if (students[0].first == 0) {
    cout << -1 << "\n";
    return 0;
  }
  std::sort(students.begin(), students.end(), std::greater<pair<int, int>>());
  int sum = 0;
  for (auto student : students) {
    sum += student.first;
  }
  if (sum < n - 1) {
    cout << -1 << "\n";
    return 0;
  }
  vector<pair<int, int>> messages;
  if (students[0].second != 1) {
    messages.push_back(std::make_pair(1, students[0].second));
  }
  int maximal = 1;
  int student_index = 0;
  while (maximal < n) {
    for (int i = 0; i < students[student_index].first; ++i) {
      if (maximal == n) {
        break;
      }
      if (students[maximal].second == 1) {
        --i;
        ++maximal;
        continue;
      }
      messages.push_back(std::make_pair(students[student_index].second,
                                        students[maximal].second));
      ++maximal;
      if (maximal == n) {
        cout << messages.size() << "\n";
        for (auto message : messages) {
          cout << message.first << " " << message.second << "\n";
        }
        return 0;
      }
    }
    ++student_index;
    if (students[student_index].second == 1) {
      --students[student_index].first;
    }
  }
  cout << messages.size() << "\n";
  for (auto message : messages) {
    cout << message.first << " " << message.second << "\n";
  }
  return 0;
}
