#include <bits/stdc++.h>
using namespace std;
struct wo {
  int tell;
  int num;
};
struct cmp {
  bool operator()(const wo &e1, const wo &e2) { return e1.tell < e2.tell; }
};
priority_queue<wo, vector<wo>, cmp> p;
priority_queue<wo, vector<wo>, cmp> q;
int s = 1, n;
int a[106] = {0};
int ans = 0;
void tell(int k) {
  if (s == n + 1) return;
  if (k != 1 & p.size()) p.pop();
  for (int i = 1; i <= a[k]; i++) {
    if (s == n) return;
    wo c = p.top();
    s++;
    if (s == n)
      return;
    else
      tell(c.num);
  }
}
void tell1(int k) {
  if (s == n + 1) return;
  if (k != 1 && q.size()) q.pop();
  for (int i = 1; i <= a[k]; i++) {
    if (s == n) return;
    wo c = q.top();
    cout << k << " " << c.num << endl;
    s++;
    if (s == n)
      return;
    else
      tell1(c.num);
  }
}
int main() {
  int vis[106] = {0}, sum = 0;
  cin >> n;
  cin >> a[1];
  sum += a[1];
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
    wo b;
    b.tell = a[i], b.num = i;
    p.push(b);
    q.push(b);
  }
  if (a[1] == 0 || sum < n - 1) {
    cout << -1;
    return 0;
  }
  tell(1);
  cout << s - 1 << endl;
  s = 1;
  tell1(1);
}
