import Control.Applicative
import Control.Monad
import Data.List

f k ((a, b):xs)
    | k <= b    = a
    | otherwise = f (k - b) xs

main :: IO ()
main = do
    [n, k] <- fmap read . words <$> getLine :: IO [Int]
    as <- fmap (sortOn fst) . replicateM n $ do
        [a, b] <- fmap read . words <$> getLine :: IO [Int]
        return (a, b)
    print (f k as)