fun main(args: Array<String>) {
    val (n, k) = readInputLine().split(" ").map { it.toLong() }
    val map = mutableMapOf<Long, Long>()
    
    for (i in 1..n) {
        val (a, b) = readInputLine().split(" ").map { it.toLong() }
        val num = map.get(a) ?: 0L
        
        map.put(a, num + b)
    }
    
    var num = 0L
    
    for (key in map.keys.toList().sorted()) {
        num += map.get(key)!!
        
        if (num >= k) {
            println(key)
            break
        }
    }
}

fun readInputLine(): String {
    return readLine()!!
}
