import java.io.{BufferedReader, InputStream, InputStreamReader, PrintWriter}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

object Main {
  val MOD = 1000000007
  val out = new PrintWriter(System.out)
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val N = sc.nextInt()

    val A = Array.fill[Int](N)(sc.nextInt())
    val Max = A.zipWithIndex.maxBy(_._1)
    val Min = A.zipWithIndex.minBy(_._1)

    def process(z: Int, range: Range) = {
      out.println(2 * N)
      val s = range.head
      rep(2){ out.println(s"$z $s") }
      range zip range.drop(1) foreach { case (i, j) =>
        rep(2){ out.println(s"$i $j") }
      }
    }

    if (abs(Max._1) > abs(Min._1)) {
      process(Max._2 + 1, 1 to N)
    } else {
      process(Min._2 + 1, (1 to N).reverse)
    }
  }


  def main(args: Array[String]): Unit = {
    solve()
    out.flush()
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

  private def rep(n: Int)(f: => Unit): Unit = {
    (0 until n) foreach (_ => f)
  }
}
