import scala.io.StdIn._

object Main extends App {
  val Array(n,k) = readLine().split(" ").map(_.toInt)
  val ab = Array.fill(n)(readLine().split(" ").map(_.toInt))
    .map(list => (list(0), list(1)))

  def solve(): Int = {
    val default = Map.empty[Int, Int]
    val numAndCntSeq: Seq[(Int, Int)] = ab.foldLeft(default) { case (acc, (a, b)) =>
      acc.updated(a, acc.getOrElse(a, 0) + b)
    }.toSeq.sortBy(_._1)

    var dropCnt = 0
    numAndCntSeq.foreach { case (num, cnt) =>
      dropCnt += cnt
      if(dropCnt >= k) return num
    }
    throw new Exception("can not find")
  }

  println(solve())

}

