let n, k = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ab_s = Array.init n @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a, b
let cs, r = Array.make 100001 0, ref 0
let _ = Array.(iter (fun (a, b) -> cs.(a) <- cs.(a) + b) ab_s; iteri (fun i c -> r := !r + c; if !r >= k then (Printf.printf "%d\n" i; exit 0)) cs)