#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n;
struct candy {
  int v, id;
} c[N];
bool operator>(candy x, candy y) { return x.v > y.v; }
vector<pair<int, int> > ans;
inline void work(candy& a, candy& b) {
  b.v -= a.v;
  a.v <<= 1;
  ans.push_back(make_pair(a.id, b.id));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &c[i].v), c[i].id = i;
  if (n <= 1) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n - 2; ++i) {
    int x = i, y = i + 1, z = i + 2, cnt = 0;
    while (true) {
      if (c[x] > c[y]) swap(c[x], c[y]);
      if (c[x] > c[z]) swap(c[x], c[z]);
      if (c[y] > c[z]) swap(c[y], c[z]);
      if (!c[x].v) break;
      int w = c[y].v / c[x].v;
      for (int t = 0; t <= 20; ++t) {
        if ((1 << t) > w) break;
        if (w & (1 << t))
          work(c[x], c[y]);
        else
          work(c[x], c[z]);
      }
    }
  }
  if (c[n - 1].v && c[n].v) {
    printf("%d\n", ans.size());
    for (pair<int, int> p : ans) printf("%d %d\n", p.first, p.second);
  } else
    puts("-1");
  return 0;
}
