#include <bits/stdc++.h>
using namespace std;
const int N = 400 + 5, M = 2e5 + 5, INFi = 1e9 + 123, MOD = 1e9 + 7, KEY = 1001;
const long long INFl = 1e18 + 123;
const double EPS = 0.00000001, INFd = 1e18 + 1234.9;
template <typename T>
inline T sqr(T t) {
  return t * t;
}
inline void file() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int n, m, k;
pair<int, int> a[N];
vector<pair<int, int> > ans;
bool used[N];
int main() {
  file();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 2, a + 1 + n);
  reverse(a + 2, a + 1 + n);
  int pos = 1;
  for (int i = 1; i <= n; i++)
    if (i > pos) {
      cout << -1;
      return 0;
    } else {
      while (pos < n && a[i].first) {
        a[i].first--;
        pos++;
        ans.push_back(make_pair(a[i].second, a[pos].second));
      }
    }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
}
