import Control.Monad
import Data.Function
import Data.List

temp t x = 1000 * t - 6 * x

err a r = abs $ 1000 * a - r

main = do
    n <- readLn :: IO Int
    [t, a] <- map read . words <$> getLine :: IO [Int]
    hs <- zip [1..n] . map read . words <$> getLine :: IO [(Int, Int)]
    print $ fst $ minimumBy (on compare (err a . temp t . snd)) hs
    