{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Data.List
import Text.Printf
import Debug.Trace
import Data.Array.ST
import Control.Monad.ST
import Data.Array.IArray

f :: [[Integer]] -> ST s (STArray s Integer Integer)
f qs = do
  arr <- newArray (1,100000) 0
  forM_ qs $ \(a:b:_) -> do
    c <- readArray arr a
    writeArray arr a (b+c)
  return arr

solve qs k = sub 0 1
  where
    arr = runSTArray (f qs)
    sub acc i = if acc + (arr!i) >= k then i
                else sub (acc + arr!i) (i+1)

main = do
  [n,k] <- getInts
  qs <- replicateM (fromIntegral n) getInts
  print $ solve qs k

-- util
getInts :: IO [Integer]
getInts = map (fst . fromJust . B.readInteger) . B.words <$> B.getLine

substr :: Int -> Int -> B.ByteString -> B.ByteString
substr b l s = B.take l $ B.drop b s
