#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, pk;
  vector<pair<int, int> > ans, v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (i == 0) pk = x;
    v.push_back(make_pair(x, i));
  }
  v[0].first = 2000000000;
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  v[0].first = pk;
  int knows = 0;
  for (int i = 0; i < n; i++) {
    if (knows >= n - 1) break;
    if (i <= knows) {
      for (int j = knows + 1; j < min(knows + 1 + v[i].first, n); j++) {
        ans.push_back(make_pair(v[i].second, v[j].second));
      }
      knows += v[i].first;
    }
  }
  if (knows >= n - 1) {
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
    }
  } else {
    cout << -1 << endl;
  }
  return 0;
}
