#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238462643383279;
const long double EPS = 1e-8;
const int NONE = 1e9 + 7;
const long long MOD = 1e9 + 7;
const int LOG = 20;
const long long maxn = 1e5 + 2;
const long long HASH_MODS[] = {1000000007333ll, 1000000009367ll,
                               1000000075747ll, 1000000158923ll,
                               1000000203119ll};
int a[101];
pair<int, int> cool[101];
vector<pair<int, int> > ans;
bool used[101];
int main() {
  int n;
  cin >> n;
  for (int i = (1); i < (n + 1); ++i) {
    cin >> a[i];
    cool[i] = {a[i], i};
  }
  sort(cool + 2, cool + n + 1);
  reverse(cool + 2, cool + n + 1);
  used[1] = true;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (i + 1); j < (n + 1); ++j) {
      if (!used[cool[j].second] && a[cool[i].second]) {
        used[cool[j].second] = 1;
        a[cool[i].second]--;
        ans.push_back({cool[i].second, cool[j].second});
      }
    }
  }
  for (int i = (1); i < (n + 1); ++i) {
    if (!used[i]) {
      cout << -1;
      return 0;
    }
  }
  cout << ans.size() << "\n";
  for (int i = (0); i < (ans.size()); ++i) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
}
