import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Ord

main :: IO ()
main = getLine >> readLine >>= main'
    where
        main' [t, a] = readLine >>= print . solve t a

solve :: Int -> Int -> [Int] -> Int
solve t a = fst . minimumBy (comparing snd) . map (\(n, x) -> (n, abs $ fromIntegral t - fromIntegral x * 0.006 - fromIntegral a)) . zip [1..]

readLine :: IO [Int]
readLine = unfoldr (\s -> second (maybe B.empty snd . B.uncons) <$> B.readInt s) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine