import           Data.List (genericLength, minimumBy)
import           Data.Ord  (comparing)

main :: IO ()
main = do
  n <- readLn
  as <- take n . map read . words <$> getLine
  print $ f as

-- foldl で書いてみたい
f :: [Int] -> Int
f as = fst . minimumBy (comparing snd) . fmap (fmap (abs . subtract average . fromIntegral)) . zip [0..] $ as
  where
    average = fromIntegral (sum as) / genericLength as
