#include <bits/stdc++.h>
using namespace std;
int n, x = 2, o;
vector<pair<int, int> > a(109);
bool w[109];
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;
  if (a[1].first) w[1] = 1;
  sort(a.begin() + 2, a.begin() + n + 1);
  reverse(a.begin() + 2, a.begin() + n + 1);
  for (int i = 1; i <= n; i++) {
    if (w[a[i].second] == 1) {
      for (int k = 0; k < a[i].first; k++) {
        if (!w[a[x].second]) {
          w[a[x].second] = 1;
          ans.push_back(make_pair(a[i].second, a[x].second));
          x++;
        }
        if (ans.size() == n - 1) {
          o = 1;
          break;
        }
      }
    }
    if (o == 1) break;
  }
  if (ans.size() == n - 1) {
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++)
      cout << ans[i].first << " " << ans[i].second << endl;
  } else
    cout << -1;
  return 0;
}
