local N, K = io.read("n", "n")
local t = {}
local keys = {}
for i=1,N do
    local a, b = io.read("n", "n")
    if t[a] then
        t[a] = t[a] + b
    else
        t[a] = b
        table.insert(keys, a)
    end
end
table.sort(keys)
local c = 0
for _,k in ipairs(keys) do
    c = c + t[k]
    if c >= K then
        print(k)
        break
    end
end

