import java.util.TreeMap

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(' ').map(String::toLong)
    val tm = TreeMap<Int, Long>()
    repeat(n.toInt()) {
        val (a, b) = readLine()!!.split(' ').map(String::toInt)
        val qty = tm[a]
        tm[a] = if (qty == null) b.toLong() else qty + b
    }
    var i = 0L
    for ((a, b) in tm) {
        i += b
        if (k <= i) {
            println(a)
            break
        }
    }
}
