#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, poly, a;
  vector<int> s;
  vector<pair<int, int> > answer;
  vector<pair<int, int> > col;
  cin >> n;
  cin >> poly;
  deque<pair<int, int> > guys;
  guys.push_back(make_pair(poly, 1));
  for (int i = 2; i <= n; ++i) {
    cin >> a;
    col.push_back(make_pair(a, i));
  }
  sort(col.begin(), col.end());
  while (col.size() > 0) {
    if (guys.size() == 0) {
      break;
    }
    pair<int, int> guy = guys.front();
    guys.pop_front();
    if (guy.first == 0) {
      continue;
    }
    pair<int, int> recipient = col.back();
    col.pop_back();
    answer.push_back(make_pair(guy.second, recipient.second));
    guys.push_back(make_pair(guy.first - 1, guy.second));
    guys.push_back(recipient);
  }
  if (answer.size() != n - 1) {
    cout << "-1" << endl;
  } else {
    cout << n - 1 << endl;
    for (int i = 0; i < answer.size(); ++i) {
      cout << answer[i].first << " " << answer[i].second << endl;
    }
  }
  return 0;
}
