#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  std::vector<std::pair<int, int>> social(n);
  int sum = 0;
  for (size_t i = 0; i < n; ++i) {
    social[i].second = i + 1;
    scanf("%d", &social[i].first);
    sum += social[i].first;
  }
  if (social[0].first == 0 || sum < n - 1) {
    printf("%d\n", -1);
    return 0;
  }
  std::sort(++(social.begin()), social.end());
  std::reverse(++(social.begin()), social.end());
  std::vector<std::pair<int, int>> connections;
  int current = 0, next = 1;
  while (true) {
    for (size_t i = 0; i < social[current].first; ++i) {
      std::pair<int, int> connection;
      connection =
          std::pair<int, int>(social[current].second, social[next++].second);
      connections.push_back(connection);
      if (next == n) break;
    }
    if (next == n) break;
    current++;
  }
  printf("%lu\n", connections.size());
  for (const auto& link : connections)
    printf("%d %d\n", link.first, link.second);
  return 0;
}
