let input = readLine()!.characters.split(" ").map{Int(String($0))!}
var arr = (0...100000).map{_ in 0}
for _ in 0..<input[0] {
    let input = readLine()!.characters.split(" ").map{Int(String($0))!}
    arr[input[0]] += input[1]
}
print(arr.enumerate().flatMap{(a,b)in(0..<b).map{_ in a}}[input[1]-1])