#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
const long long maxn = 2e3 + 10, N = 2e6 + 10, SQ = 320, base = 1999,
                mod = 1e9 + 7, INF = -1e9, lg = 26;
long long n, sum;
pair<long long, long long> a[maxn];
vector<pair<long long, long long> > ans;
inline void set_boxes(long long i, long long j, long long k) {
  if (a[i].first > a[j].first) {
    swap(a[i], a[j]);
  }
  if (a[i].first > a[k].first) {
    swap(a[i], a[j]);
  }
  if (a[j].first > a[k].first) {
    swap(a[j], a[k]);
  }
}
void modify(long long i, long long j, long long k) {
  set_boxes(i, j, k);
  while (a[i].first) {
    long long p = a[j].first / a[i].first;
    while (p) {
      if (p & 1) {
        a[i].first *= 2;
        a[j].first -= a[i].first / 2;
        ans.push_back({a[i].second, a[j].second});
      } else {
        a[i].first *= 2;
        a[k].first -= a[i].first / 2;
        ans.push_back({a[i].second, a[k].second});
      }
      p /= 2;
    }
    set_boxes(i, j, k);
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
    sum += a[i].first;
  }
  if (sum < 2) {
    cout << -1 << '\n';
    return 0;
  }
  for (long long i = 0; i < n - 2; ++i) {
    modify(i, i + 1, i + 2);
  }
  cout << ans.size() << '\n';
  for (auto u : ans) {
    cout << u.first + 1 << ' ' << u.second + 1 << '\n';
  }
}
