#include <bits/stdc++.h>
using namespace std;
int n, k;
bool b[150];
pair<int, int> a[150];
vector<pair<int, int> > v;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a + 1, a + n);
  reverse(a + 1, a + n);
  b[0] = 1;
  for (int i = 0; i < n && b[i]; ++i) {
    k = a[i].first;
    for (int j = i + 1; k > 0 && j < n; ++j)
      if (!b[j]) {
        b[j] = 1;
        --k;
        v.push_back({a[i].second, a[j].second});
      }
  }
  if (!b[n - 1]) return cout << -1, 0;
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); ++i)
    cout << v[i].first << ' ' << v[i].second << "\n";
}
