import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N = in.next().toInt
  val a = new Array[Int](N)

  for (i <- 0 until N) {
    a(i) = in.next().toInt
  }

  var mx = a.max
  var mn = a.min

  def printer(ans: List[(Int, Int)]): Unit = {
    pw.println(ans.length)
    for (e <- ans)
      pw.println(s"${e._1} ${e._2}")
    pw.flush()
  }

  var ans: List[(Int, Int)] = List()

  if (Math.abs(mx) == 0 && Math.abs(mn) == 0) {
    println(0)
  }
  else if (Math.abs(mx) > Math.abs(mn)) {
    var ind = 0
    for (i <- 0 until N) {
      if(a(i) == mx)
        ind = i
    }

    for (i <- 0 until N) {
      ans = (ind, i) :: ans
    }

    for(i <- 1 until N) {
      ans = (i-1, i) :: ans
    }

    printer(ans.reverse)
  }
  else {
    var ind = 0
    for (i <- 0 until N) {
      if(a(i) == mn)
        ind = i
    }

    for (i <- 0 until N) {
      ans = (ind, i) :: ans
    }

    for(i <- (0 until N-1).reverse) {
      ans = (i+1, i) :: ans
    }

    printer(ans.reverse)
  }
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
