object Main extends App {
  val scan = new java.util.Scanner(System.in)
  val ns: Array[Long] = Array.fill(1e5.toInt + 1)(0l)
  val n, k = scan.next().toInt
  for (_ <- 1 to n) yield ns(scan.next().toInt) += scan.next().toInt
  val acc = ns.scanLeft(0l)((s, n) => s + n).drop(1)
  println((0 to ns.length).zip(acc).dropWhile(_._2 < k).head._1)
}