import Data.List
import Data.Ratio

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)
      | abs(averageTemp t hi - a % 1) < abs(averageTemp t hj - a % 1) = (i, hi)
      | otherwise                                                     = (j, hj)

averageTemp :: Int -> Int -> Ratio Int
averageTemp t x = t % 1 - x * 6 % 1000
