import java.util.Comparator

fun main(args: Array<String>) {
    val N = nextInt()
    val A = listOfInt().toIntArray()
    val B = A.sorted()
    val ans = mutableListOf<Pair<Int, Int>>()
    if (B.first().sign() != B.last().sign()) {
        val max = if (-B.first() > B.last()) B.first() else B.last()
        var p = 0; while (A[p] != max) p += 1
        for (n in 0 until N) {
            if (A[n] != max) {
                ans.add(p to n)
                A[n] += max
            }
        }
    }
//System.err.println(A.joinToString(" "))
    if (A.first().sign() == 1) {
        for (n in 1 until N) {
            ans.add(n - 1 to n)
            A[n] += A[n - 1]
        }
    } else {
        for (n in (0 until N - 1).reversed()) {
            ans.add(n + 1 to n)
            A[n] += A[n + 1]
        }
    }
    println(ans.size)
    ans.forEach { println("${it.first + 1} ${it.second + 1}") }
//System.err.println(A.joinToString(" "))
}
fun Int.sign() = if (this >= 0) 1 else -1

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfLong() = listOfString().map(String::toLong)
