import Control.Monad
import Data.List

main :: IO ()
main = do
  [n, k] <- getInts
  as <- replicateM n $ do
    [i, j] <- getInts
    return (i, j)
  print $ solve k $ sort as
  
getInts :: IO [Int]
getInts = map read . words <$> getLine

solve :: Int -> [(Int, Int)] -> Int
solve 0 ((a, b):ns) = a
solve k ((a, b):ns) = if k <= b
                      then a
                      else solve (k - b) ns
