object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = List.fill(n)(sc.nextInt())
  val (x, idx) = a.zipWithIndex.maxBy(_._1.abs)

  println(2 * (n-1))
  for (i <- 1 to n if i != idx + 1) {
    println(s"${idx + 1} $i")
  }

  if (x >= 0) {
    for (i <- 1 until n) {
      println(s"${i} ${i+1}")
    }
  } else {
    for (i <- n until 1 by -1) {
      println(s"${i} ${i-1}")
    }
  }
}