#include <bits/stdc++.h>
using namespace std;
void fn() {}
inline int Rand() { return (rand() << 16) | rand(); }
const double eps = 1e-9, Pi = acos(-1);
const int N = 2e5 + 5, second = 2e3 + 5;
const int MOD = 1e9 + 7, inf = 21e8;
const long long INF = 9e18;
int was[second], n, pos;
pair<int, int> a[second];
vector<pair<int, int> > ans;
void dfs(int v) {
  was[a[v].second] = 1;
  for (int i = 1; i <= a[v].first; i++) {
    for (int u = 1; u <= n; u++)
      if (!was[a[u].second]) {
        ans.push_back(make_pair(a[v].second, a[u].second)), dfs(u);
        break;
      }
  }
}
int main() {
  fn();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++)
    if (a[i].second == 1) pos = i;
  dfs(pos);
  for (int i = 1; i <= n; i++)
    if (!was[i]) cout << -1, exit(0);
  cout << ans.size() << endl;
  for (auto i : ans) cout << i.first << " " << i.second << endl;
  return 0;
}
