object Main extends App {
	
	val N = scala.io.StdIn.readInt
	var A = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	var i = 0

	var l1 = List[Int]()
	var l2 = List[Int]()

	do{
		if(A(i) > A(i+1)){
			if(A(i) < 0){
				A(i) = A(i) + A(i+1)
				l1 = (i+2) :: l1
				l2 = (i+1) :: l2
			}else{
				A(i+1) = A(i+1) + A(i)
				l1 = (i+1) :: l1
				l2 = (i+2) :: l2
			}
		}else{
			i = i + 1
		}

	}while(i < (N-1))

	if(l1.size == 0){
		println(0)
	}else{
		println(l1.size)

		l1 = l1.reverse
		l2 = l2.reverse

		for(i<-0 until l1.size){
			println(l1(i) + " " + l2(i))
		}
	}





}
