#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[200];
int n, x;
vector<pair<int, int> > res;
int main() {
  int sum = 0;
  cin >> n;
  cin >> a[0].first;
  a[0].second = 0;
  sum += a[0].first;
  for (int i = 1; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    sum += a[i].first;
  }
  if (a[0].first == 0 || sum < n - 1) {
    cout << -1;
    return 0;
  }
  sort(a + 1, a + n);
  reverse(a + 1, a + n);
  int x = 0;
  int y = 1;
  cout << n - 1 << endl;
  while (y < n) {
    cout << a[x].second + 1 << " " << a[y].second + 1 << endl;
    y++;
    a[x].first--;
    if (a[x].first == 0) x++;
  }
  return 0;
}
