import java.math.*;

object MainKt {
  @JvmStatic fun main(args:Array<String>) {
   val (N,K) = readLine()!!.split(" ").map(String::toLong)
    val action= (1..N).map {
      val (a,b)=readLine()!!.split(" ").map(String::toInt)
      Pair(a,b)
    }
    val sorted_list=action.toMutableList()
    sorted_list.sortBy {it.first}
      // println(sorted_list.get(K-1))
    var index=K
    for(pair in sorted_list)
    {
      index-=pair.second
      if(index<=0)
      {
        println(pair.first)
        break
      }
    }

  }

}
