#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500;
pair<int, int> a[MAXN];
pair<int, int> cur;
bool was[MAXN];
int p = 0;
vector<pair<int, int> > ans;
queue<int> q;
void accept() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 2, a + n + 1, greater<pair<int, int> >());
  q.push(1);
  was[1] = true;
  p = 2;
  while (!q.empty() && p <= n) {
    cur = a[q.front()];
    q.pop();
    for (int i = p; i < p + cur.first && i <= n; ++i) {
      q.push(i);
      ans.push_back({cur.second, a[i].second});
      was[a[i].second] = true;
    }
    p += cur.first;
  }
  for (int i = 1; i <= n; ++i) {
    if (!was[i]) {
      cout << -1;
      return;
    }
  }
  cout << ans.size() << endl;
  for (auto& res : ans) {
    cout << res.first << " " << res.second << endl;
  }
}
int main() {
  accept();
  return 0;
}
