local n = io.read("*n")
local a = {}
local minus = false
local absmax, pos = 0, 1
local mma, mab = math.max, math.abs
for i = 1, n do
  a[i] = io.read("*n")
  if a[i] < 0 then
    if absmax < -a[i] then
      absmax = -a[i]
      pos = i
      minus = true
    end
  else
    if absmax < a[i] then
      absmax = a[i]
      pos = i
      minus = false
    end
  end
end
print(2 * n - 2)
for i = 1, n do
  if i ~= pos then
    print(pos .. " " .. i)
  end
end
if minus then
  for i = n, 2, -1 do
    print(i .. " " .. i - 1)
  end
else
  for i = 1, n - 1 do
    print(i .. " " .. i + 1)
  end
end
