import scala.io.StdIn._
object Main extends App {
  val Array(n, k) = readLine.trim.split(' ').map(_.toLong)
  val operations = Array.tabulate(n.toInt){_ ⇒
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
    (a, b)
  }.sortBy(_._1)
  val count = operations.map(_._2.toLong)
  for (i ← count.indices.tail) count(i) += count(i - 1)
  println(operations(lowerBound(count, k))._1)
  def lowerBound(array: Array[Long], target: Long): Int = {
    var left = 0
    var right = array.length
    while(left < right) {
      val mid = (left + right) / 2
      if (array(mid) < target) left = mid + 1
      else right = mid
    }
    right
  }
}