import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial, std.numeric;

void main(){
    auto nk=readln.split.map!(to!long).array;
    auto N=nk[0];
    auto K=nk[1];
    auto tree=new RedBlackTree!(int[],"a[0]<b[0]",true);
    foreach(i;0..N)tree.insert(readln.split.map!(to!int).array);
    long count=0;
    foreach(elm;tree[]){
        count+=elm[1];
        if(count>=K){
            writeln(elm[0]);
            return;
        }
    }
}