program ABC061C
    implicit none
    integer(8)::N,K,a,b,i,count
    integer(8),dimension(100000)::L
    read(5,*)N,K
    L=0
    count=0

    do i=1,N
        read(5,*)a,b
        L(a)=L(a)+b
    end do

    do i=1,100000
        count=count+L(i)
        if(count>=K)then
            print'(i0)',i
            exit
        end if
    end do
end program ABC061C