import Data.List
import Control.Monad

main = do
    [n, k] <- map read . words <$> getLine
    abss <- replicateM n $ map read . words <$> getLine
    print . getIndex k $ sort abss

getIndex k ([a,b]:abss)
    | b >= k    = a
    | otherwise = getIndex (k - b) abss
