#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(const T &a) {
  return a * a;
}
const int MAXN = 300;
pair<int, int> a[MAXN];
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, cnt;
  scanf("%d", &n);
  scanf("%d", &cnt);
  int cur = 0;
  for (int i = 0; i < (n - 1); i++) {
    scanf("%d", &a[i].first), a[i].second = i + 1;
  }
  sort(a, a + n - 1);
  reverse(a, a + n - 1);
  int pos = 0;
  for (int i = 0; i < (n - 1); i++) {
    if (i > pos) {
      puts("-1");
      return 0;
    }
    while (pos != n - 1 && cnt) {
      ans.push_back({cur, a[pos].second}), cnt--, pos++;
    }
    cnt = a[i].first;
    cur = a[i].second;
  }
  if (pos < n - 1)
    puts("-1");
  else {
    printf("%d\n", (int)ans.size());
    for (pair<int, int> p : ans) printf("%d %d\n", p.first + 1, p.second + 1);
  }
}
