#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[1011];
vector<pair<int, int> > ans;
inline void yichuan(int i, int j) {
  a[j].first -= a[i].first;
  a[i].first <<= 1;
  ans.emplace_back(a[i].second, a[j].second);
}
int solve() {
  cin >> n;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    if (a[i].first) c++;
  }
  if (c < 2) return puts("-1");
  for (int i = 1; i <= n - 2; i++) {
    sort(a + i, a + i + 3);
    while (a[i].first) {
      int shang = a[i + 1].first / a[i].first;
      while (shang) {
        if (shang & 1)
          yichuan(i, i + 1);
        else
          yichuan(i, i + 2);
        shang >>= 1;
      }
      sort(a + i, a + i + 3);
    }
  }
  cout << (int)ans.size() << endl;
  for (pair<int, int> u : ans) printf("%d %d\n", u.first, u.second);
}
int main() {
  solve();
  return 0;
}
