#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int>> message;
  vector<pair<int, int>> res;
  vector<int> isGet(n);
  double totalSum;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    message.push_back({temp, i});
    isGet[i] = false;
    totalSum += temp;
  }
  if (n - 1 > totalSum) {
    cout << -1;
    return 0;
  }
  isGet[0] = 1;
  if (message[0].first == 0) {
    cout << -1;
    return 0;
  }
  int count = 0;
  int from = 0;
  int to = 0;
  while (count < n - 1) {
    if (message[from].first == 0) {
      for (int j = 0; j < n; j++) {
        if (isGet[j] && message[j].first != 0) {
          from = j;
          break;
        }
      }
    }
    int max = -1;
    for (int j = 1; j < n; j++) {
      if (max < message[j].first && !isGet[j]) {
        max = message[j].first;
        to = j;
      }
    }
    res.push_back({from, to});
    message[from].first--;
    isGet[to] = true;
    count++;
  }
  cout << res.size() << endl;
  for (auto& p : res) cout << p.first + 1 << " " << p.second + 1 << endl;
}
