#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 30;
const int N = 100 + 10;
int cnt[N];
bool visit[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &cnt[i]);
  }
  visit[0] = true;
  queue<int> Q;
  Q.push(0);
  vector<pair<int, int>> ret;
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    int rem = cnt[u];
    set<pair<int, int>, greater<pair<int, int>>> A;
    for (int k = 0; k < n; ++k) {
      if (visit[k]) continue;
      A.insert({cnt[k], k});
    }
    for (auto& it : A) {
      if (rem == 0) break;
      int k = it.second;
      visit[k] = true;
      --rem;
      Q.push(k);
      ret.push_back({u, k});
    }
  }
  bool found = false;
  for (int i = 0; i < n; ++i) {
    if (!visit[i]) {
      found = true;
    }
  }
  if (found) {
    puts("-1");
  } else {
    printf("%d\n", (int)ret.size());
    for (auto& it : ret) {
      printf("%d %d\n", it.first + 1, it.second + 1);
    }
  }
  return 0;
}
