#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int maxn = 100010;
int A[maxn], N;
struct point {
  int x, y;
  point() {}
  point(int _x = 0, int _y = 0) {
    x = _x;
    y = _y;
  }
};
bool cmp(int x, int y) { return A[x] < A[y]; }
vector<point> ans;
void solve(int x, int y, int z) {
  int a[4];
  a[1] = x;
  a[2] = y;
  a[3] = z;
  for (;;) {
    sort(a + 1, a + 4, cmp);
    if (!A[a[1]]) return;
    int now = A[a[2]] / A[a[1]];
    while (now) {
      if (now & 1)
        A[a[2]] -= A[a[1]], ans.push_back(point(a[1], a[2]));
      else
        A[a[3]] -= A[a[1]], ans.push_back(point(a[1], a[3]));
      A[a[1]] <<= 1;
      now >>= 1;
    }
  }
}
int main() {
  cin >> N;
  int tot = 0;
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]), tot += !!A[i];
  if (tot < 2) return cout << -1, 0;
  int p1 = 0, p2 = 0;
  for (int i = 1; i <= N; i++)
    if (A[i]) {
      if (!p1)
        p1 = i;
      else if (!p2)
        p2 = i;
      else {
        solve(p1, p2, i);
        if (!A[p1]) p1 = i;
        if (!A[p2]) p2 = i;
      }
    }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) printf("%d %d\n", ans[i].x, ans[i].y);
  return 0;
}
