#include <bits/stdc++.h>
using namespace std;
const int LEN = 109;
int n;
int a[LEN];
bool know[LEN];
vector<pair<int, int>> ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  know[0] = true;
  for (int i = 0; i < n; i++) {
    if (!know[i]) continue;
    for (int j = 0; j < n; j++) {
      if (a[i] == 0) break;
      if (i == j) continue;
      if (know[j]) continue;
      if (a[j] == 0) continue;
      a[i]--;
      know[j] = true;
      ans.push_back(make_pair(i + 1, j + 1));
    }
  }
  for (int i = 0; i < n; i++) {
    if (!know[i]) continue;
    for (int j = 0; j < n; j++) {
      if (a[i] == 0) break;
      if (i == j) continue;
      if (know[j]) continue;
      a[i]--;
      know[j] = true;
      ans.push_back(make_pair(i + 1, j + 1));
    }
  }
  for (int i = 0; i < n; i++) {
    if (!know[i]) {
      printf("-1");
      return 0;
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
}
