import Control.Monad
import Data.List

calc k ds = head $ dropWhile (\(_, s) -> s<k) ps
  where 
    ps = scanl (\(_, s) (a, b) -> (a, s+b)) (0, 0) $ sort ds


main = map read . words <$> getLine >>= \[n, k] -> replicateM n ((\[a, b] -> (a, b)) . map read . words <$> getLine) >>= print . fst . calc k