#include <bits/stdc++.h>
using namespace std;
bool arr[101];
vector<pair<int, int>> ve;
vector<pair<int, int>> ans;
int n, m, k, sum, pos;
int main() {
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &m);
    ve.push_back(make_pair(m, i));
  }
  if (k == 0) {
    printf("-1");
    return 0;
  }
  sort(ve.rbegin(), ve.rend());
  sum += k;
  pos = 1;
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i; j < n - 1; ++j) {
      if (sum == 0) break;
      if (!arr[ve[j].second]) {
        ans.push_back(make_pair(pos, ve[j].second));
        arr[ve[j].second] = true;
        --sum;
      }
    }
    sum = ve[i].first;
    pos = ve[i].second;
  }
  for (int i = 2; i <= n; ++i) {
    if (!arr[i]) {
      printf("-1");
      return 0;
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
