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 = a[0];
    int index = 0;
    for (int i = 0; i < a.length; i++) {
        if (abs(x) < abs(a[i])) {
            x = a[i];
            index = i;
        }
    }

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

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

    writeln(ans.length);
    foreach (e; ans) {
        writeln(e[0] + 1, " ", e[1] + 1);
        a[e[1]] += a[e[0]];
    }
}

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