import scala.collection.mutable.TreeMap
import scala.annotation.tailrec

object Main extends App {
  val Array(n, k) = io.StdIn.readLine.split(" ").map(_.toLong)
  val map = TreeMap.empty[Int, Long]
  Iterator.continually(io.StdIn.readLine)
    .take(n.toInt)
    .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:TreeMap[Int, Long], k:Long):Int = {
    val ite = map.keys.iterator

    @tailrec
    def rec(acc:Long, key:Int, k:Long ):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))
}