#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007, dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
const double eps = 1e-8;
void read(int &k) {
  k = 0;
  char x = getchar();
  while (x < '0' || x > '9') x = getchar();
  while (x >= '0' && x <= '9') {
    k = k * 10 - 48 + x;
    x = getchar();
  }
}
int n, tot, a[1010], p, q, len;
pair<int, int> ot[1000010];
void mv(int x, int y) {
  ot[++len] = make_pair(y, x);
  a[x] -= a[y];
  a[y] <<= 1;
}
void solve(int x, int y, int z, int &retx, int &rety) {
  if (a[x] > a[y]) swap(x, y);
  if (a[x] > a[z]) swap(x, z);
  if (a[y] > a[z]) swap(y, z);
  int p = a[y] / a[x];
  for (int i = 0; i <= 30 && (p >> i); i++)
    if ((p >> i) & 1)
      mv(y, x);
    else
      mv(z, x);
  if (!a[x])
    retx = y, rety = z;
  else if (!a[y])
    retx = x, rety = z;
  else if (!a[z])
    retx = x, rety = y;
  else
    solve(x, y, z, retx, rety);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i]) tot++;
  }
  if (tot < 2) {
    puts("-1");
    return 0;
  }
  for (p = 1; !a[p]; p++)
    ;
  for (q = p + 1; !a[q]; q++)
    ;
  for (int i = q + 1; i <= n; i++)
    if (a[i]) {
      int np, nq;
      solve(p, q, i, np, nq);
      p = np;
      q = nq;
    }
  printf("%d\n", len);
  for (int i = 1; i <= len; i++) printf("%d %d\n", ot[i].first, ot[i].second);
  return 0;
}
