#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  vector<int> num;
  vector<int> ans1;
  vector<int> ans2;
  int n, sum = 0, ind = 1;
  cin >> n;
  a.resize(n);
  num.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    num[i] = i;
  }
  if (a[0] == 0) {
    cout << -1;
    return 0;
  }
  if (sum < n - 1) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < n - 1; j++) {
      if (a[j + 1] > a[j]) {
        swap(a[j], a[j + 1]);
        swap(num[j], num[j + 1]);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= a[i]; j++) {
      if (ind <= n - 1) {
        ans1.push_back(num[i]);
        ans2.push_back(num[ind]);
        ind++;
      }
    }
  }
  cout << ans1.size() << "\n";
  for (int i = 0; i < ans1.size(); i++) {
    cout << ans1[i] + 1 << " " << ans2[i] + 1 << "\n";
  }
}
