#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000 + 10;
int n;
int a[MAX], b[MAX], top;
int cmp(int l, int r) { return a[l] < a[r]; }
int ansx[MAX * MAX], ansy[MAX * MAX], tot;
void work(int c, int d) {
  a[c] -= a[d];
  a[d] *= 2;
  ansx[++tot] = c;
  ansy[tot] = d;
}
int main() {
  int i, j;
  scanf("%d", &n);
  int num = 0;
  for ((i) = (1); (i) <= (n); ++(i)) {
    scanf("%d", &a[i]);
    if (a[i]) ++num;
  }
  if (num < 2) {
    printf("-1\n");
    return 0;
  }
  while (1) {
    top = 0;
    for ((j) = (1); (j) <= (n); ++(j))
      if (a[j]) b[++top] = j;
    if (top == 2) break;
    sort(b + 1, b + 4, cmp);
    int& A = b[1];
    int& B = b[2];
    int& C = b[3];
    while (a[A]) {
      int q = a[B] / a[A];
      for (; q; q /= 2)
        if (q % 2 == 1)
          work(B, A);
        else
          work(C, A);
      sort(b + 1, b + 4, cmp);
    }
  }
  cout << tot << endl;
  for ((i) = (1); (i) <= (tot); ++(i))
    cout << ansy[i] << " " << ansx[i] << endl;
  return 0;
}
