import Text.Printf
import Data.List
import Data.Maybe
import Control.Applicative
import Control.Monad

main = do
  n <- readLn :: IO Int
  as <- map read . words <$> getLine :: IO [Int]

  let
    mina = minimum as
    maxa = maximum as

  print $ 2*n-1
  if abs mina < abs maxa then do
    forM_ [1..n] $ \i -> printf "%d %d\n" ((+1) . fromJust . elemIndex maxa $ as) i
    forM_ [1..n-1] $ \i -> printf "%d %d\n" i (i+1)
    else do
    forM_ [1..n] $ \i -> printf "%d %d\n" ((+1) . fromJust . elemIndex mina $ as) i
    forM_ [n,n-1..2] $ \i -> printf "%d %d\n" i (i-1)

