fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map{it.toLong()}
    val ps = Array(N.toInt()) {
        val (a, b) = readLine()!!.split(" ").map{it.toLong()}
        Pair(a, b)
    }
    ps.sortBy { it.first }

    var s = 0L

    for (p in ps) {
        s += p.second
        if (s >= K) {
            println(p.first)
            return
        }
    }
}