#include <bits/stdc++.h>
using namespace std;
int n, kk;
vector<pair<int, int> > ans, a;
bool used[200];
int main() {
  cin >> n;
  a.resize(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  if (a[1].first == 0) {
    cout << -1;
    return 0;
  }
  used[1] = true;
  sort(a.begin() + 2, a.end());
  reverse(a.begin() + 2, a.end());
  for (int j = 1; j <= n; ++j) {
    kk = 0;
    for (int i = 1; i <= n; ++i) {
      if (kk == a[j].first) break;
      if (!used[a[i].second] && i != j) {
        kk++;
        used[a[i].second] = true;
        ans.push_back({a[j].second, a[i].second});
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!used[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].first << ' ' << ans[i].second << "\n";
  return 0;
}
