#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int n;
int a[MAXN];
bool used[MAXN];
int q[MAXN];
void solve() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  vector<pair<int, int>> ans;
  int sz = 0;
  q[sz++] = 0;
  used[0] = true;
  for (int ind = 0; ind < sz; ++ind) {
    int v = q[ind];
    vector<pair<int, int>> go;
    for (int i = 0; i < n; ++i)
      if (!used[i]) go.emplace_back(a[i], i);
    sort(go.begin(), go.end());
    reverse(go.begin(), go.end());
    for (int i = 0; i < min(a[v], (int)go.size()); ++i) {
      int to = go[i].second;
      ans.emplace_back(v, to);
      used[to] = true;
      q[sz++] = to;
    }
  }
  if (sz != n) {
    puts("-1");
    return;
  }
  printf("%d\n", ans.size());
  for (auto p : ans) printf("%d %d\n", p.first + 1, p.second + 1);
}
int main() {
  solve();
  (void)0;
  return 0;
}
