#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int> > ar;
long long int vist[102];
vector<pair<long long int, long long int> > v;
int main() {
  long long int i, a, b, j, n, t;
  cin >> n;
  vist[1] = 1;
  long long int cnt = 1;
  cin >> a;
  cnt += a;
  for (i = 2; i <= n; i++) {
    cin >> b;
    ar.push_back(make_pair(b, i));
  }
  sort((ar).begin(), (ar).end());
  reverse((ar).begin(), (ar).end());
  for (i = 0; i < min(a, (long long int)ar.size()); i++) {
    vist[ar[i].second] = 1;
    v.push_back(make_pair(1, ar[i].second));
  }
  for (i = 0; i < ar.size(); i++) {
    if (vist[ar[i].second]) {
      long long int c = 1;
      for (j = 0; j < ar.size(); j++) {
        if (ar[i].second != ar[j].second) {
          if (c > ar[i].first) break;
          if (!vist[ar[j].second]) {
            c++;
            cnt++;
            vist[ar[j].second] = 1;
            v.push_back(make_pair(ar[i].second, ar[j].second));
          }
        }
      }
    }
  }
  if (cnt < n) {
    cout << -1 << endl;
    return 0;
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
}
