#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 5;
pair<int, int> a[MAX_N];
vector<pair<int, int> > ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; (i) < (n); ++i) scanf("%d", &a[i].first), a[i].second = i;
  if (a[0].first == 0) {
    puts("-1");
    return 0;
  }
  sort(a + 1, a + n);
  reverse(a + 1, a + n);
  int toSendIt = 1;
  int curIt = 0;
  while (toSendIt < n) {
    while (curIt < n && a[curIt].first == 0) curIt++;
    if (curIt == n) {
      puts("-1");
      return 0;
    }
    a[curIt].first--;
    ans.push_back({a[curIt].second, a[toSendIt++].second});
  }
  printf("%d\n", (int)((ans).size()));
  for (auto np : ans) printf("%d %d\n", np.first + 1, np.second + 1);
  return 0;
}
