#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; i++) {
    a[i].second = i + 1;
    cin >> a[i].first;
  }
  sort(a.begin() + 1, a.end(), greater<pair<int, int>>());
  queue<pair<int, int>> q;
  q.push(a[0]);
  int cnt = 1;
  vector<pair<int, int>> res;
  int uses[1000] = {0};
  int p = 1;
  while (!q.empty()) {
    pair<int, int> v = q.front();
    q.pop();
    for (int i = 0; i < v.first; ++i) {
      if (p + i < n) {
        q.push(a[p + i]);
        cnt++;
        res.push_back(make_pair(v.second, a[p + i].second));
      }
    }
    p += v.first;
  }
  if (cnt < n) {
    cout << -1;
    return 0;
  }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); ++i) {
    cout << res[i].first << ' ' << res[i].second << '\n';
  }
}
