import java.util.*

fun main(args:Array<String>) {
    val (n,k) = readLine()!!.split(" ").map { it.toLong() }
    val cnt = TreeMap<Int,Long>()
    (1..n.toInt()).forEach {
        val (a,b) = readLine()!!.split(" ").map { it.toInt() }
        val tmp = (cnt[a]?:0L) + b
        cnt[a] = tmp
    }
    var cur = 0L
    for(key in cnt.keys) {
        cur += cnt[key]!!
        if(cur >= k) {
            println(key)
            return
        }
    }

}

