#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> as;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    as.push_back(a);
  }
  auto minIx = min_element(as.begin(), as.end());
  auto maxIx = max_element(as.begin(), as.end());

  min_element(as.begin(), as.end());
  auto printIter = abs(*minIx) < abs(*maxIx)
               ? maxIx
               : minIx;
  auto printIx = distance(as.begin(), printIter) + 1;
  if( abs(*minIx) < abs(*maxIx) ){
    cout << n*2-1 << endl;
    for(int i = 1; i <= n; i++) {
      cout << printIx << " " << i << endl;
    }

    for(int i = 1; i < n; i++){
      cout << i << " " << i + 1 << endl;
    }
    
  } else {
    cout << n*2-1 << endl;
    for(int i = 1; i <= n; i++) {
      cout << printIx << " " << i << endl;
    }
    for(int i = n; i > 1; i--){
      cout << i << " " << i - 1 << endl;
    }
  }
}
