#include <iostream>
using namespace std;
#define abs(x) (x>0?(x):(-(x)))

int main() {
  int n, a;
  int max, min, maxd, mind;
  max = min = maxd = mind = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    if (a >= max) {
      max = a;
      maxd = i;
    }
    if (a <= min) {
      min = a;
      mind = i;
    }
  }
  cout << 2*n - 1 << endl;
  if (abs(max) >= abs(min)) {
    for (int i = 1; i <= n; ++i) {
      cout << maxd << " " << i << endl;
    }
    for (int i = 1; i < n; ++i) {
      cout << i << " " << i+1 << endl;
    }
  } else if (abs(max) < abs(min)) {
    for (int i = 1; i <= n; ++i) {
      cout << mind << " " << i << endl;
    }
    for (int i = n; i > 1; --i) {
      cout << i << " " << i-1 << endl;
    }
  }
  return 0;
}