import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

alias Query = Tuple!(int, "x", int, "y");

void main() {
    int n;
    scan(n);
    auto a = readln.split.to!(int[]);

    int amax = -10^^7, amin = 10^^7;
    int maxi, mini;

    foreach (int i, ai; a) {
        if (ai > amax) {
            amax = ai;
            maxi = i;
        }
        if (ai < amin) {
            amin = ai;
            mini = i;
        }
    }

    if (amax == amin && amax == 0) {
        writeln(0);
        return;
    }

    auto ans = new Query[](0);

    if (abs(amax) > abs(amin)) {
        if (maxi != 1) {
            ans ~= Query(maxi + 1, 2);
            ans ~= Query(maxi + 1, 2);
        }

        foreach (i ; 2 .. n) {
            ans ~= Query(i, i + 1);
            ans ~= Query(i, i + 1);
        }
    }
    else {
        if (mini != n - 2) {
            ans ~= Query(mini + 1, n - 1);
            ans ~= Query(mini + 1, n - 1);
        }

        foreach_reverse (i ; 1 .. n - 1) {
            ans ~= Query(i + 1, i);
            ans ~= Query(i + 1, i);
        }
    }

    writeln(ans.length);
    foreach (qi ; ans) {
        writefln("%d %d", qi.x, qi.y);
    }
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}