import Data.List

main :: IO ()
main = do
  _ <- getLine
  [t, a] <- readInts
  hs <- readInts
  print $ solve t a hs

readInts :: IO [Int]
readInts = map read . words <$> getLine

solve :: Int -> Int -> [Int] -> Int
solve t a = fst . foldl1' f . zip [1..]
  where
    f (i, hi) (j, hj)
      | dist_a hi > dist_a hj = (i, hi)
      | otherwise             = (j, hj)

    dist_a x = abs((6000 * t - x) - 6000 * a)
