#include <bits/stdc++.h>
using namespace std;
struct node {
  int data, num;
};
node a[1010];
int cnt, ans[1000010][2];
bool cmp(node x, node b) { return (x.data < b.data); }
void push(int x, int y) {
  ans[++cnt][0] = a[y].num;
  ans[cnt][1] = a[x].num;
  a[x].data -= a[y].data;
  a[y].data <<= 1;
}
int main() {
  int n, m = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x) {
      a[++m].data = x;
      a[m].num = i;
    }
  }
  if (m < 2) {
    printf("-1\n");
    return 0;
  }
  cnt = 0;
  for (int i = 1; i <= m - 2; i++) {
    sort(a + i, a + i + 3, cmp);
    while (a[i].data) {
      int t = a[i + 1].data / a[i].data;
      while (t) {
        if (t & 1)
          push(i + 1, i);
        else
          push(i + 2, i);
        t >>= 1;
      }
      sort(a + i, a + i + 3, cmp);
    }
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) printf("%d %d\n", ans[i][0], ans[i][1]);
  return 0;
}
