import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.List
import Data.Array.ST
import Data.Array (elems)
import Data.Maybe (fromJust)


solve :: [[Int]] -> Int -> Int -> Int
solve (x:xs) k count
    | count + b >= k = a
    | otherwise = solve xs k (count + b)
    where
        (a:b:_) = x

sortByNumber :: [Int] -> [Int] -> Ordering
sortByNumber (a:_) (b:_)
    | a >= b = GT
    | otherwise = LT

main :: IO ()
main = do
    [n, k] <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
    arr <- replicateM n (map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine)
    let arr2 = sortBy sortByNumber arr
    print $ solve arr2 k 0

