import Control.Monad
import Data.List

solve :: Int -> [(Int, Int)] -> Int
solve k ((a, b):rs)
  | k <= b = a
  | True = solve (k - b) rs


main :: IO ()
main = do
  n:k:_ <- fmap (\x -> read x :: Int) <$> words <$> getLine
  l <- fmap ((\[a, b] -> (a, b)) . (fmap (\x -> read x :: Int)) . words) <$> replicateM n getLine
  print $ solve k $ sort l
