#include <bits/stdc++.h>
using namespace std;
const long double PI = acos((long double)-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 200200;
const int LEN = 20;
int n;
pair<int, int> a[1000];
int w;
vector<pair<int, int> > E;
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);
  while ((int)E.size() != n - 1 && w <= (int)E.size()) {
    if (a[w].first == 0)
      w++;
    else {
      a[w].first--;
      int NUM = (int)E.size();
      E.push_back(make_pair(a[w].second, a[NUM + 1].second));
    }
  }
  if ((int)E.size() == n - 1) {
    cout << n - 1 << "\n";
    for (int i = (0); i < (n - 1); i++)
      cout << E[i].first << " " << E[i].second << "\n";
  } else
    cout << -1;
}
