#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 50;
int N, a[MAX_N];
int main() {
  cin >> N;
  int ma = 0;
  for (int i = (0); i < (N); i++) {
    cin >> a[i];
    if (abs(a[i]) > abs(a[ma])) {
      ma = i;
    }
  }
  int f;
  if (a[ma] >= 0) {
    f = 1;
  } else {
    f = -1;
  }
  cout << 2 * (N - 1) << endl;
  for (int i = (0); i < (N); i++) {
    if (i != ma) {
      cout << ma + 1 << " " << i + 1 << endl;
    }
  }
  for (int i = (0); i < (N - 1); i++) {
    if (f == 1) {
      cout << i + 1 << " " << i + 2 << endl;
    } else {
      cout << N - i << " " << N - i - 1 << endl;
    }
  }
  return 0;
}
