#include <bits/stdc++.h>
using namespace std;
int n;
int a[1010];
int p[4];
bool cmp(int x, int y) { return a[x] < a[y]; }
int ans;
int op[1000100][2];
void work() {
  int k;
  while (a[p[1]]) {
    k = a[p[2]] / a[p[1]];
    while (k) {
      ans++;
      if (k & 1)
        a[p[2]] -= a[p[1]], op[ans][1] = p[2], op[ans][0] = p[1];
      else
        a[p[3]] -= a[p[1]], op[ans][1] = p[3], op[ans][0] = p[1];
      a[p[1]] <<= 1;
      k >>= 1;
    }
    sort(p + 1, p + 4, cmp);
  }
}
int main() {
  scanf("%d", &n);
  if (n == 1) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  p[2] = 1, p[3] = 2;
  for (int i = 3; i <= n; ++i) {
    p[1] = i;
    sort(p + 1, p + 4, cmp);
    work();
  }
  if (a[p[2]] == 0) {
    puts("-1");
    return 0;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; ++i) printf("%d %d\n", op[i][0], op[i][1]);
  return 0;
}
