#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
struct student {
  int index, messages;
  bool operator<(const student s) const { return messages > s.messages; }
};
int ans[MAXN][2];
student arr[MAXN];
queue<student> writers;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i].messages;
    arr[i].index = i + 1;
  }
  sort(arr + 1, arr + n);
  writers.push(arr[0]);
  int pos = 1;
  while (writers.size() && pos < n) {
    student current = writers.front();
    writers.pop();
    for (int i = 0; i < current.messages && pos < n; ++i) {
      ans[pos - 1][0] = current.index;
      ans[pos - 1][1] = arr[pos].index;
      writers.push(arr[pos]);
      pos++;
    }
  }
  if (pos < n)
    cout << -1 << endl;
  else {
    cout << n - 1 << endl;
    for (int i = 0; i < n - 1; ++i)
      cout << ans[i][0] << " " << ans[i][1] << endl;
  }
  return 0;
}
