#include <bits/stdc++.h>
using namespace std;
long long fix(long long cur) {
  return ((cur % 1000000007) + 1000000007) % 1000000007;
}
int n, x;
vector<pair<int, int> > arr;
bool vis[101];
vector<pair<int, int> > ans;
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr.push_back({x, i});
  }
  sort(arr.rbegin(), arr.rend() - 1);
  vis[0] = true;
  for (int i = 0; i < n; i++) {
    if (vis[arr[i].second]) {
      for (int j = 0; j < n && arr[i].first > 0; j++) {
        if (vis[arr[j].second] == false) {
          vis[arr[j].second] = true;
          arr[i].first--;
          ans.push_back({arr[i].second + 1, arr[j].second + 1});
        }
      }
    }
  }
  if (!ans.size()) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (vis[i] == false) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
