#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535;
long long powi(long long base, int p) {
  long long res = 1;
  while (p--) res *= base;
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool is_vowel(char c) {
  c = tolower(c);
  return c == 'a' || c == 'e' || c == 'o' || c == 'i' || c == 'u' || c == 'y';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 1, v; i <= n; i++) {
    cin >> v;
    if (i == 1) v += 101;
    a[i - 1] = {v, i};
  }
  sort(a.begin(), a.end());
  a[n - 1].first -= 101;
  vector<pair<int, int>> res;
  int i = n - 2, j = n - 1;
  while (i >= 0 && i != j) {
    if (a[j].first > 0) {
      res.push_back({a[j].second, a[i].second});
      a[j].first--;
      i--;
    } else
      j--;
  }
  if (res.size() == n - 1) {
    cout << res.size() << '\n';
    for (auto p : res) cout << p.first << ' ' << p.second << '\n';
  } else
    cout << -1;
  return 0;
}
