#include <bits/stdc++.h>
using namespace std;
const int NMax = 1100;
struct pii {
  int x, y;
};
pii mp(int x, int y) {
  pii ret;
  ret.x = x;
  ret.y = y;
  return ret;
}
bool cmp(pii a, pii b) { return a.x < b.x; }
vector<pii> Q;
int N;
pii A[NMax];
void gao(int i, int j, int k) {
  int d = A[j].x / A[i].x;
  int tmp[20], l = 0;
  while (d) {
    tmp[l++] = (d & 1);
    d >>= 1;
  }
  for (int i1 = 0; i1 < l; i1++) {
    if (tmp[i1] == 0) {
      A[k].x -= A[i].x;
      A[i].x *= 2;
      Q.push_back(mp(A[i].y, A[k].y));
    } else {
      A[j].x -= A[i].x;
      A[i].x *= 2;
      Q.push_back(mp(A[i].y, A[j].y));
    }
  }
}
int main() {
  scanf("%d", &N);
  int cnt = 0;
  for (int i = 1; i <= N; i++) {
    int x;
    scanf("%d", &x);
    A[i] = mp(x, i);
    if (x) cnt++;
  }
  if (cnt < 2) {
    puts("-1");
    getchar();
    getchar();
    return 0;
  }
  while (1) {
    sort(A + 1, A + N + 1, cmp);
    if (A[N - 2].x == 0) break;
    gao(N - 2, N - 1, N);
  }
  printf("%d\n", Q.size());
  for (int i = 0; i < Q.size(); i++) printf("%d %d\n", Q[i].x, Q[i].y);
  getchar();
  getchar();
  return 0;
}
