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) {
  // readln;
  solve("-2 5 -1");
}

auto solve(string line1) {
  auto a = line1.split.map!(to!int).array;
  auto N = a.length;
  auto max_i = a.maxIndexAlt;
  auto min_i = a.minIndexAlt;
  
  (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 + 1, y + 1).writeln;
  }

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

  a.writeln;
}

pure auto maxIndexAlt(T)(T[] arr) {
  auto max = arr.front;
  auto res = 0;
  foreach(int i; 0..cast(int)arr.length) {
    if (max < arr[i]) {
      max = arr[i];
      res = i;
    }
  }
  return res;
} unittest {
  assert([4, 6, 3, 0, 1].maxIndexAlt == 1);
}

pure auto minIndexAlt(T)(T[] arr) {
  auto min = arr.front;
  auto res = 0;
  foreach(int i; 0..cast(int)arr.length) {
    if (arr[i] < min) {
      min = arr[i];
      res = i;
    }
  }
  return res;
} unittest {
  assert([4, 6, 3, 0, 1].minIndexAlt == 3);
}
