fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map(String::toLong)
    val sortedList = (1..N).map { readLine()!!.split(" ").map(String::toLong) }.sortedBy { it[0] }
    var sum = 0L
    for (pair in sortedList) {
        sum += pair[1]
        if (sum >= K) {
            println(pair[0])
            break
        }
    }
}
