#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e3 + 10;
int vis[N];
vector<pair<int, int>> vp;
int main() {
  vector<pair<int, int>> ans;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    vp.push_back({x, i});
  }
  vis[0] = 1;
  sort(vp.rbegin(), vp.rend() - 1);
  for (int i = 0; i < n; i++) {
    if (!vis[i]) break;
    int cnt = vp[i].first;
    for (int j = i + 1; j < n; j++) {
      if (vis[j]) continue;
      if (cnt == 0) break;
      ans.push_back({vp[i].second, vp[j].second});
      cnt--;
      vis[j] = 1;
    }
  }
  if (ans.size() != n - 1)
    puts("-1");
  else {
    cout << ans.size() << endl;
    for (auto &p : ans) cout << p.first << ' ' << p.second << endl;
  }
  return 0;
}
