#include <bits/stdc++.h>
using namespace std;
vector<int> v;
vector<bool> used;
int n;
void pseudo_DFS(int vert) {
  used[vert] = 1;
  if (v[vert] == 0) return;
  for (int i = 0; i < n; i++) {
    if (vert == i) continue;
    if (v[vert] == 0) break;
    if ((!used[i]) && (v[i] > 0) && (v[vert] > 0)) {
      v[vert]--;
      cout << vert + 1 << " " << i + 1 << "\n";
      pseudo_DFS(i);
    }
  }
  for (int i = 0; i < n; i++) {
    if (vert == i) continue;
    if (v[vert] == 0) break;
    if ((!used[i]) && (v[vert] > 0)) {
      v[vert]--;
      cout << vert + 1 << " " << i + 1 << "\n";
      pseudo_DFS(i);
    }
  }
}
int main() {
  cin >> n;
  v.resize(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int sum = 0;
  for (int i = 0; i < n; i++) sum += v[i];
  if ((sum < n - 1) || (v[0] == 0)) {
    cout << -1;
    return 0;
  }
  used.assign(n, 0);
  used[0] = 1;
  cout << n - 1 << "\n";
  pseudo_DFS(0);
}
