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

void main() {
  int n = readln.chomp.to!int;
  auto a = readln.chomp.split.map!(to!int).array;

  auto m = reduce!(min, max)(a);

  if (m[0] == m[1]) {
    writeln(0);
  }
  else if (m[0] >= 0) {
    writeln(n - 1);
    for (int i = 0; i < n - 1; ++i) {
      writeln(i + 1, " ", i + 2);
    }
  }
  else if (m[1] < 0) {
    writeln(n - 1);
    for (int i = n - 1; i > 0; --i) {
      writeln(i + 1, " ", i);
    }
  }
  else {
    if (abs(m[0]) > abs(m[1])) {
      writeln(n - 1 + n - 1);

      int p;
      for (int i = 0; i < n; ++i) {
        if (a[i] == m[0]) {
          p = i;
          break;
        }
      }
      for (int i = 0; i < n; ++i) {
        if (i == p) continue;
        writeln(p + 1, " ", i + 1);
      }
      for (int i = n - 1; i > 0; --i) {
        writeln(i + 1, " ", i);
      }
    }
    else {
      writeln(n - 1 + n - 1);

      int p;
      for (int i = 0; i < n; ++i) {
        if (a[i] == m[1]) {
          p = i;
          break;
        }
      }
      for (int i = 0; i < n; ++i) {
        if (i == p) continue;
        writeln(p + 1, " ", i + 1);
      }
      for (int i = 0; i < n - 1; ++i) {
        writeln(i + 1, " ", i + 2);
      }
    }
  }
}