import Data.List (minimumBy)
import Data.Function (on)

main = do n <- readLn :: IO Int
          [t, a] <- map read . words <$> getLine
          hs <- map read . words <$> getLine
          let assc = zip [1..] [abs (1000 * a - 1000 * t - 6 * h) | h <- hs]
          print $ fst $ minimumBy (compare `on` snd) assc