#include <bits/stdc++.h>
using namespace std;
int n, a[111], used[111];
vector<pair<int, int> > v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i != 1) v.push_back(make_pair(a[i], i));
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  used[1] = 1;
  queue<int> q;
  q.push(1);
  int ans = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int ch = a[u];
    int w = 0, e = 0;
    while (w < v.size() && e < ch) {
      int to = v[w].second;
      if (used[to] == 0) {
        used[to] = 1;
        q.push(to);
        e++;
        ans++;
      }
      w++;
    }
  }
  for (int i = 1; i <= n; i++)
    if (used[i] == 0) {
      cout << -1;
      exit(0);
    } else
      used[i] = 0;
  used[1] = 1;
  q.push(1);
  cout << ans << endl;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int ch = a[u];
    int w = 0, e = 0;
    while (w < v.size() && e < ch) {
      int to = v[w].second;
      if (used[to] == 0) {
        used[to] = 1;
        q.push(to);
        e++;
        cout << u << ' ' << to << endl;
      }
      w++;
    }
  }
  return 0;
}
