import java.math.BigInteger
import java.util.*

class D( private val n: Int, var invert: Boolean = false, private val r: ArrayList<String> = ArrayList( 2 * n ) ) {
    fun addLine( x: Int, y: Int ) {
        if ( ! invert ) {
            r.add( "${x + 1} ${y + 1}" )
        } else {
            r.add( "${n - x} ${n - y}" )
        }
    }

    fun print() {
        println( r.size )
        for ( rr in r ) {
            println( rr )
        }
    }

//    fun check( b: IntArray ) {
//
//    }
}

fun main( args: Array<String> ) {
    val sc = Scanner( System.`in` )
    val n = sc.nextInt()
    val d = D( n )
    val a = Array<BigInteger>( n, { sc.nextBigInteger() } )
//    val b = a.clone()
    run {
        val min = a.min()!!
        val max = a.max()!!
        if ( max < BigInteger.ZERO || ( min < BigInteger.ZERO && min.negate() > max ) ) {
            d.invert = true
            a.reverse()
            for ( i in a.indices ) {
                a[i] = a[i].negate()
            }
        }
    }
    for ( i in a.indices ) {
        val maxI = a.indices.maxBy { a[it] }!!
        if ( a[i] < BigInteger.ZERO ) {
            d.addLine( maxI, i )
            a[i] = a[i].add( a[maxI] )
        }
        if ( i > 0 && a[i] < a[i - 1] ) {
            d.addLine( i - 1, i )
            a[i] = a[i].add( a[i - 1] )
        }
    }
//    d.check( b )
    d.print()
}