#include <bits/stdc++.h>
using namespace std;
vector<bool> pri(1e6 + 1, true);
vector<long long int> prime;
void seive() {
  for (long long int i = 2; i * i < 1e6; i++) {
    if (pri[i]) {
      prime.push_back(i);
      for (long long int j = i * i; j < 1e6; j += i) {
        pri[j] = false;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n + 1];
  a[0] = 0;
  int c[n + 1];
  c[0] = 0;
  int sum = 0;
  vector<int> v1;
  vector<int> v2;
  vector<int> v3;
  vector<int> v4;
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    c[i] = a[i];
    sum += a[i];
    if (a[i] == 0)
      v1.push_back(i);
    else
      v2.push_back(i);
  }
  if (a[1] == 0) {
    cout << -1 << "\n";
    return 0;
  } else {
    if (sum < n - 1) {
      cout << -1 << "\n";
      return 0;
    } else {
      int j = 1, l = 0;
      cout << n - 1 << "\n";
      while (n - 1 >= j) {
        if (a[v2[l]] != 0) {
          a[v2[l]]--;
          v3.push_back(v2[l]);
          j++;
        } else {
          l++;
        }
      }
      for (int i = 1; i < v2.size(); i++) {
        v4.push_back(v2[i]);
      }
      for (int i = 0; i < v1.size(); i++) {
        v4.push_back(v1[i]);
      }
      for (int i = 0; i < n - 1; i++) {
        cout << v3[i] << " " << v4[i] << "\n";
      }
    }
  }
}
