solve :: [Double] -> Int -> Int
solve a n = snd $ minimum $ fmap (\(v, i) -> (abs (v - ave), i)) $ zip a [0 .. n - 1]
  where
    ave = (foldl (+) 0 a) / (fromIntegral n)

main :: IO ()
main = do
  n <- readLn :: IO Int
  a <- (fmap (\x -> read x :: Double)) . words <$> getLine
  print $ solve a n

