#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool cmp(const T& a, const T& b) {
  return a.first < b.first;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > ar(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> ar[i].first;
    ar[i].second = i;
  }
  vector<bool> used(n + 1);
  vector<pair<int, int> > ans;
  used[1] = 1;
  sort(ar.rbegin(), ar.rend() - 2);
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      cout << -1;
      return 0;
    } else {
      for (int j = i + 1; j <= n; j++) {
        if (ar[i].first > 0 && used[j] != 1) {
          ans.push_back({ar[i].second, ar[j].second});
          ar[i].first--;
          used[j] = 1;
        }
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto it : ans) {
    cout << it.first << ' ' << it.second << '\n';
  }
  return 0;
}
