#include <bits/stdc++.h>
using namespace std;
int const diff = 'a' - 'A';
short int const soo = 32767;
int const oo = 2147483647;
long long const loo = 9223372036854775807;
int arr[110];
bool test[110];
vector<int> ans[110];
int main() {
  long long n;
  cin >> n;
  ;
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> res;
  res.push_back(0);
  test[0] = 1, arr[102] = -10;
  int g = 0, idx = 0;
  while (idx < res.size()) {
    while (arr[res[idx]]--) {
      int u = 102;
      for (int i = 0; i < n; i++) {
        if (arr[i] > arr[u] && !test[i]) u = i;
      }
      if (u == 102) {
        arr[res[idx]] = 0;
        break;
      }
      test[u] = 1;
      ans[res[idx]].push_back(u);
      res.push_back(u);
      g++;
    }
    idx++;
  }
  for (int i = 0; i < n; i++) {
    if (!test[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << g << endl;
  res.clear(), res.push_back(0), idx = 0;
  while (idx < res.size()) {
    for (int j = 0; j < ans[res[idx]].size(); j++) {
      cout << res[idx] + 1 << " " << ans[res[idx]][j] + 1 << endl;
      res.push_back(ans[res[idx]][j]);
    }
    idx++;
  }
}
