#include <bits/stdc++.h>
struct Compare {
  bool operator()(std::pair<int, int> left, std::pair<int, int> right) {
    if (left.second < right.second) return true;
    if (left.second > right.second) return false;
    return left.first < right.first;
  }
};
int main() {
  int n;
  std::cin >> n;
  std::vector<std::pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> a[i].second;
    a[i].first = i + 1;
  }
  if (a[0].second == 0) {
    std::cout << -1 << std::endl;
    return 0;
  }
  long long sum = 0;
  int i = 0;
  while (sum < n - 1 && i < n) sum += a[i++].second;
  if (sum < n - 1) {
    std::cout << -1 << std::endl;
    return 0;
  }
  std::sort(a.begin() + 1, a.end(), Compare());
  std::cout << n - 1 << std::endl;
  int maxNotUsed = n - 1;
  while (a[0].second > 0 && maxNotUsed > 0) {
    --a[0].second;
    std::cout << 1 << ' ' << a[maxNotUsed--].first << std::endl;
  }
  auto iter = a.end() - 1;
  while (maxNotUsed > 0) {
    while (iter->second-- > 0 && maxNotUsed > 0)
      std::cout << iter->first << ' ' << a[maxNotUsed--].first << std::endl;
    --iter;
  }
  return 0;
}
