#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e4;
const int INF = 1e9;
const int MOD = 1e9 + 7;
void bye() {
  cout << '\n';
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> g(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> g[i];
    sum += g[i];
  }
  vector<int> used(n, 0);
  vector<pair<int, int> > ans;
  int done = 0;
  if (g[0] == 0 || sum < n - 1) {
    cout << -1;
    bye();
  }
  used[0] = 1;
  while (g[0]) {
    int pos = -1, mx = 0;
    for (int i = 0; i < n; i++) {
      if (!used[i] && g[i] >= mx) {
        mx = g[i];
        pos = i;
      }
    }
    if (pos == -1) {
      break;
    }
    used[pos] = 1;
    ans.push_back({1, pos + 1});
    done++;
    g[0]--;
  }
  while (done < n - 1) {
    int pos = -1;
    for (int i = 0; i < n; i++) {
      if (used[i] && g[i] != 0) {
        pos = i;
        break;
      }
    }
    int pos1 = -1, mx1 = -1;
    for (int i = 0; i < n; i++) {
      if (!used[i] && g[i] > mx1) {
        mx1 = g[i];
        pos1 = i;
      }
    }
    if (pos == -1 || pos1 == -1) {
      break;
    }
    g[pos]--;
    used[pos1] = 1;
    ans.push_back({pos + 1, pos1 + 1});
    done++;
  }
  cout << (int)(ans).size() << "\n";
  for (int i = 0; i < (int)(ans).size(); i++) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
  bye();
}
