import scala.collection.mutable.HashMap

object Main extends App {
  val Array(n, k) = io.StdIn.readLine.split(" ").map(_.toInt)
  val map = HashMap.empty[Int, Long]
  Iterator.continually(io.StdIn.readLine)
    .take(n)
    .map(_.split(" "))
    .foreach(e => {
      val key   = e(0).toInt
      val value = e(1).toLong
      if(!map.contains(key)) map += key -> value
      else map(key) += value
    })

  def f(map:HashMap[Int, Long], k:Int):Int = {
    val ite = map.keys.toList.sorted.iterator

    def rec(acc:Long, key:Int, k:Int ):Int = {
      val res = acc + map(key)
      if(res >= k) key
      else rec(res, ite.next, k)
    }

    rec(0L, ite.next, k)
  }

  println(f(map, k))
}