#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin() + 1, a.end());
  reverse(a.begin() + 1, a.end());
  queue<int> q;
  q.push(0);
  int ptr = 1;
  vector<pair<int, int> > ans;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    int friends = a[v].first;
    int id = a[v].second;
    while (friends--) {
      if (ptr < n) {
        ans.push_back(make_pair(id, a[ptr].second));
        q.push(ptr++);
      }
    }
  }
  if (ptr != n) {
    cout << -1 << "\n";
    return 0;
  }
  cout << ans.size() << "\n";
  for (auto x : ans) {
    cout << x.first + 1 << " " << x.second + 1 << "\n";
  }
  return 0;
}
