#include <bits/stdc++.h>
std::vector<std::pair<int, int> > a;
std::vector<std::pair<int, int> > ans;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  std::cin >> n;
  for (size_t i = 0; i < n; i++) {
    int x;
    std::cin >> x;
    a.emplace_back(x, i + 1);
  }
  std::sort(a.rbegin(), a.rend() - 1);
  size_t current = 0;
  size_t next = 1;
  while (next < a.size()) {
    if (current >= next) {
      std::cout << -1 << std::endl;
      return 0;
    }
    if (a[current].first <= 0) {
      current++;
      continue;
    }
    ans.emplace_back(a[current].second, a[next++].second);
    a[current].first--;
  }
  std::cout << ans.size() << std::endl;
  for (size_t i = 0; i < ans.size(); i++) {
    std::cout << ans[i].first << " " << ans[i].second << std::endl;
  }
  return 0;
}
