#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int N, a[MAXN], p[MAXN], ax[MAXN], ay[MAXN], al;
void chg(int x, int y) {
  ax[++al] = x, ay[al] = y;
  a[y] -= a[x], a[x] += a[x];
}
void solve(int x, int y, int z) {
  while (1) {
    if (a[p[x]] > a[p[y]]) swap(p[x], p[y]);
    if (a[p[x]] > a[p[z]]) swap(p[x], p[z]);
    if (a[p[y]] > a[p[z]]) swap(p[y], p[z]);
    if (!a[p[x]]) return;
    int k = a[p[y]] / a[p[x]], t = k * a[p[x]], pos = 0;
    while (a[p[x]] <= t) {
      if (k & (1 << pos))
        chg(p[x], p[y]);
      else
        chg(p[x], p[z]);
      ++pos;
    }
  }
}
int main() {
  scanf("%d", &N);
  int zero = 0;
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &a[i]);
    if (a[i]) ++zero;
  }
  if (zero <= 1) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= N; ++i) p[i] = i;
  for (int i = 1; i <= N - 2; ++i) solve(i, i + 1, i + 2);
  printf("%d\n", al);
  for (int i = 1; i <= al; ++i) {
    printf("%d %d\n", ax[i], ay[i]);
  }
  return 0;
}
