#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
} a[1111];
bool b;
bool cmp(point a, point b) {
  if (a.x < b.x) return true;
  return false;
}
vector<int> vec;
int main() {
  long long n;
  cin >> n;
  long long sum = 0;
  for (long long j = 0; j < n; j++) {
    cin >> a[j].x;
    a[j].y = j;
    sum += a[j].x;
  }
  if (sum < n - 1 || !a[0].x) {
    cout << -1;
    return 0;
  }
  sort(a + 1, a + n, cmp);
  for (long long e = 0; e < a[0].x; e++) vec.push_back(0);
  cout << n - 1 << endl;
  for (long long i = n - 1; i > 0; i--) {
    cout << vec[vec.size() - 1] + 1 << " " << a[i].y + 1 << endl;
    vec.pop_back();
    for (long long j = a[i].x; j > 0; j--) vec.push_back(a[i].y);
  }
  return 0;
}
