#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  int q = 0;
  set<pair<int, int>> s;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    q += a[i];
    if (i) s.insert({-a[i], i + 1});
  }
  if (q < n - 1 || !a[0]) {
    cout << -1 << '\n';
    return 0;
  }
  set<pair<int, int>> w;
  vector<pair<int, int>> res;
  while (a[0]-- && !s.empty()) {
    res.push_back({1, s.begin()->second});
    w.insert(*s.begin());
    s.erase(s.begin());
  }
  while (!w.empty() && !s.empty()) {
    if (!w.begin()->second) {
      break;
    }
    res.push_back({w.begin()->second, s.begin()->second});
    auto kek = *w.begin();
    w.erase(w.begin());
    ++kek.first;
    w.insert(kek);
    w.insert(*s.begin());
    s.erase(s.begin());
  }
  if (s.size()) {
    cout << -1 << '\n';
  }
  cout << res.size() << '\n';
  for (auto x : res) {
    cout << x.first << " " << x.second << '\n';
  }
}
