#include <bits/stdc++.h>
const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const long long MXLL = 4611686018427387903;
const int Sz = 1110111;
using namespace std;
inline void Read_rap() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
}
int n;
pair<int, int> a[Sz];
vector<pair<int, int> > ans;
int main() {
  Read_rap();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 2, a + n + 1);
  reverse(a + 2, a + n + 1);
  int ptr = 2;
  for (int i = 1; i <= n; i++) {
    if (ptr <= i) {
      cout << -1;
      return 0;
    }
    for (; ptr <= n && a[i].first; ptr++, a[i].first--) {
      ans.push_back(make_pair(a[i].second, a[ptr].second));
    }
  }
  cout << (int)(ans.size()) << endl;
  for (auto i : ans) cout << i.first << ' ' << i.second << endl;
  return 0;
}
