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

void main(string[] args) {
  solve(readln);
}

auto solve(string line1) {
  auto a = line1.split.map!(to!int).array;
  auto N = a.length;
  auto max_i = a.maxIndex;
  auto min_i = a.minIndex;
  
  (2 * N - 1).writeln;
  
  int x = abs(a[min_i]) < abs(a[max_i]) ? max_i : min_i;
  foreach(y; 0..N) {
    a[y] += a[x];
    "%d %d".format(x, y).writeln;
  }

  if (a.all!"a >= 0") {
    foreach(y; 1..N) {
      a[y] += a[y - 1];
      "%d %d".format(y - 1, y).writeln;
    }
  } else {
    foreach(k; 1..N) {
      auto y = N - k - 1;
      a[y] += a[y + 1];
      "%d %d".format(y + 1, y).writeln;
    }
  }
}
