import scala.io.StdIn._

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

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

    var dropCnt = 0L
    numAndCntSeq.foreach { case (num, cnt) =>
      dropCnt += cnt
      if(dropCnt >= k) return num
    }
    -1L
  }

  println(solve())

}

