#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch - '0' < 0 || ch - '0' > 9) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch - '0' >= 0 && ch - '0' <= 9) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n;
int a[1010];
int ansx[3000010], ansy[3000010], top;
void work(int x, int y) {
  ansx[++top] = y;
  ansy[top] = x;
  a[x] -= a[y];
  a[y] <<= 1;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  int x, y = 1, z = 2;
  for (int i = 3; i <= n; i++) {
    x = i;
    while (true) {
      if (a[x] > a[y]) swap(x, y);
      if (a[y] > a[z]) swap(y, z);
      if (a[x] > a[y]) swap(x, y);
      if (!a[x]) break;
      int k = a[y] / a[x];
      for (int j = 0; j <= log2(k); j++) {
        if ((k >> j) & 1)
          work(y, x);
        else
          work(z, x);
      }
    }
  }
  if (a[x] > y) swap(x, y);
  if (a[y] > z) swap(y, z);
  if (a[x] > y) swap(x, y);
  if (a[y] == 0) {
    puts("-1");
    return 0;
  }
  printf("%d\n", top);
  for (int i = 1; i <= top; i++) printf("%d %d\n", ansx[i], ansy[i]);
  return 0;
}
