import Control.Applicative( (<$>))
import Data.IntMap.Strict
import qualified Data.IntMap.Strict as M
import Control.Monad( replicateM)

main = do
    let
	readPair = do
	    [a,b] <- Prelude.map read . words <$> getLine
	    return (a,b)

    [n_, k_] <- Prelude.map read . words <$> getLine
    abs_ <- replicateM n_ readPair
    let
	dataMap = fromListWith (+) abs_

	search c [] = c
	search c ((v,amount):pairs) = let
					c' = c+amount
				    in
					if k_<=c'
					  then v
					  else search c' pairs
    
    print $ search 0 (toList dataMap)