#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n, a[N], ar[N][2], ap;
bool cmp_q(int i, int j) { return a[i] < a[j]; }
void act(int u, int v) {
  a[v] -= a[u];
  a[u] += a[u];
  ar[++ap][0] = u, ar[ap][1] = v;
}
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    cnt += (a[i] > 0);
  }
  if (cnt <= 1) {
    printf("-1\n");
    return 0;
  }
  while (cnt-- > 2) {
    int q[3] = {0}, tq = 0;
    for (int i = 1; i <= n && tq < 3; ++i)
      if (a[i]) q[tq++] = i;
    for (;;) {
      sort(q, q + 3, cmp_q);
      if (!a[q[0]]) break;
      for (int b = a[q[1]] / a[q[0]]; b; b >>= 1)
        if (b & 1)
          act(q[0], q[1]);
        else
          act(q[0], q[2]);
    }
  }
  printf("%d\n", ap);
  for (int i = 1; i <= ap; ++i) {
    printf("%d %d\n", ar[i][0], ar[i][1]);
  }
}
