import Data.List
import Data.Function
main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  [t,a] <- map read . words <$> getLine :: IO [Int]
  hs <- map read . words <$> getLine :: IO [Int]
  let degs = map (\h -> abs $ 1000 * t - 6*h - 1000 * a) hs
      ans = minimumBy (compare `on` snd) $ zip [1..] degs
  print $ fst ans