import Control.Monad
import qualified Data.IntMap as M

main = do
  li <- getLine
  let [n,k] = map read $ words li
  abs <- forM [1..n] (\_ -> do
    li <- getLine
    let [a,b] = map read $ words li
    return (a,b)
    )
  let ans = compute k abs
  print ans

{-
大きさをキーに、要素数を値にしたIntMapを更新する
キーの小さい順に取り出して、k番目を特定する
-}

compute :: Int -> [(Int,Int)] -> Int
compute k abs = loop k (M.assocs m)
  where
    m = foldl step M.empty abs
    step m (a,b) = M.insertWith (+) a b m
    loop k ((a,b):abs)
      | k <= b = a
      | True   = loop (k-b) abs
