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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void calc(int[] a) {
    int x = int.min, index;
    for (int i = 0; i < a.length; i++) {
        if (abs(x) < abs(a[i])) {
            x = a[i];
            index = i;
        }
    }

    auto step = (a.length - 1) + (a.length - 1);
    writeln(step);

    for (int i = 0; i < a.length; i++) {
        if (i == index) continue;
        writeln(index + 1, " ", i + 1);
        a[i] += a[index];
    }

    if (a[index] >= 0) {
        // 左端から累積和をとる
        for (int i = 1; i < a.length; i++) {
            writeln((i - 1) + 1, " ", i + 1);
            a[i] += a[i - 1];
        }
    }
    else {
        // 右端から累積和をとる
        for (int i = cast(int) a.length - 2; i >= 0; i--) {
            writeln(i + 1, " ", (i + 1) + 1);
            a[i] += a[i + 1];
        }
    }

    for (int i = 1; i < a.length; i++) {
        assert(a[i] >= a[i - 1]);
    }
}

void main() {
    readint;
    auto a = readints;
    calc(a);
}
