#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int n, parent[N], orgRem[N];
pair<int, int> rem[N];
vector<pair<int, int> > res;
int main() {
  scanf("%d", &n);
  for (int i = (1), _i = (n); i <= _i; ++i) {
    int localRem;
    scanf("%d", &localRem);
    orgRem[i] = -localRem;
    rem[i] = {-localRem, i};
  }
  sort(rem + 1, rem + n + 1);
  int next = 1;
  while (orgRem[1] && next <= n) {
    if (rem[next].second != 1) {
      parent[rem[next].second] = 1;
      ++orgRem[1];
      res.push_back({1, rem[next].second});
    }
    next++;
  }
  parent[1] = 1;
  for (int i = 1; i <= n && next <= n; ++i) {
    int curr = rem[i].second;
    while (curr != 1 && parent[curr] && rem[i].first && next <= n) {
      if (!parent[rem[next].second]) {
        parent[rem[next].second] = curr;
        res.push_back({curr, rem[next].second});
        ++rem[i].first;
      }
      ++next;
    }
  }
  if (next <= n) {
    cout << "-1";
  } else {
    printf("%d\n", res.size());
    for (auto& p : res) {
      printf("%d %d\n", p.first, p.second);
    }
  }
}
