#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 5;
const long long INF = (1ll << 32);
const double PI = 3.14159265359;
const long long mod = 1e9 + 7;
int n, x, cnt;
vector<int> ans;
pair<int, int> a[111111];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  cin >> x;
  for (int i = 1; i <= n - 1; ++i) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  if (x == 0) {
    cout << -1;
    return 0;
  }
  sort(a + 1, a + 1 + n, greater<pair<int, int> >());
  cnt = x;
  for (int i = 1; i <= n; ++i) {
    if (cnt || i == n) {
      --cnt;
      cnt += a[i].first;
    } else {
      cout << -1;
      return 0;
    }
  }
  int g = 1;
  cout << n - 1 << "\n";
  cout << "1 " << a[1].second << "\n";
  --x;
  for (int i = 2; i <= n - 1; ++i) {
    if (x) {
      cout << 1 << " ";
      --x;
    } else if (a[g].first > 0) {
      cout << a[g].second << " ";
      --a[g].first;
    } else {
      cout << a[++g].second << "  ";
      --a[g].first;
    }
    cout << a[i].second << "\n";
  }
}
