import qualified Data.ByteString.Char8 as BC
import qualified Data.IntMap as M
import Data.Maybe (fromJust)
import Data.List

main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  input <- getInt2DListBC
  let ans = sort . concat $ map (\[x, y] -> replicate y x) input
  print $ ans !! (k - 1)

bsToInt :: BC.ByteString -> Int
bsToInt = fst . fromJust . BC.readInt

getInt2DListBC :: IO [[Int]]
getInt2DListBC = map (map bsToInt . BC.words) . BC.lines <$> BC.getContents