import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    auto N = readln.chomp.to!int;
    auto a = readln.split.to!(int[]).array;

    Tuple!(int, int)[] outputResult;
    alias output = (x,y) => outputResult ~= tuple(x, y);
    auto positiveMax = max(0, a.reduce!max);
    auto negativeMax = max(0, -a.reduce!min);

    if (positiveMax > negativeMax) {
        //all positive
        auto maxIndex = cast(int)a.enumerate.reduce!((a,b) => a.value > b.value ? a : b).index;
        foreach (i; 0..N) {
            if (a[i] < 0) {
                output(maxIndex, i);
            }
        }
        // maximize left
        output(maxIndex, 0);
        // all up
        foreach (i; 1..N) {
            output(i, i+1);
        }
    } else {
        // all negative
        auto minIndex = cast(int)a.enumerate.reduce!((a,b) => a.value < b.value ? a : b).index;
        foreach (i; 0..N) {
            if (a[i] > 0) {
                output(minIndex, i);
            }
        }
        // minimize right
        output(minIndex, N-1);
        // all down
        foreach_reverse(i; 1..N) {
            output(i-1,i);
        }
    }

    writeln(outputResult.length);
    foreach (o; outputResult) {
        writefln("%d %d", o[0]+1, o[1]+1);
    }
}

