open Batteries
let n, k = Scanf.scanf "%d %d" (fun x y -> x, y)
let arr = Array.make 100010 0
let () =
  (1--n) |> Enum.iter begin fun _ ->
    Scanf.scanf " %d %d" (fun a b -> arr.(a) <- arr.(a) + b)
  end;
  (1--100000) |> Enum.iter begin fun i ->
    arr.(i) <- arr.(i) + arr.(i-1)
  end;
  Array.findi (fun v -> v >= k) arr
  |> Printf.printf "%d\n"
