#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
template <typename T>
void print2(T v) {
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v[i].size(); j++) cout << v[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
template <typename T>
void print_pair(T v) {
  for (int i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
  cout << endl;
}
vector<pair<int, int> > a;
vector<pair<int, int> > answ;
vector<char> used;
int n;
void f(int k) {
  for (int i = 0; i < n && a[k].first > 0; i++) {
    if (!used[i]) {
      used[i] = true;
      answ.push_back(make_pair(a[k].second, a[i].second));
      a[k].first--;
      f(i);
    }
  }
}
int main() {
  cin >> n;
  used.assign(n, false);
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int k;
  for (int i = 0; i < n; i++) {
    if (a[i].second == 0) {
      k = i;
      break;
    }
  }
  if (a[k].first == 0) {
    cout << -1;
    return 0;
  }
  used[k] = true;
  f(k);
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << answ.size() << endl;
  for (int i = 0; i < answ.size(); i++) {
    cout << answ[i].first + 1 << " " << answ[i].second + 1 << endl;
  }
  return 0;
}
