local n, k = io.read("*n", "*n")
local t = {}
for i = 1, n do
  local arr = {
    a = io.read("*n"),
    b = io.read("*n"),
  }
  table.insert(t, arr)
end
table.sort(t, function(t1, t2) return t1.a < t2.a end)
for i = 1, n do
  k = k - t[i].b
  if k <= 0 then
    print(t[i].a)
    os.exit()
  end
end