implicit none
integer :: n
integer(8) :: k
integer(8) :: cnt(100000)
integer :: i,a,b

cnt(:) = 0

read *,n,k

do i = 1, n
   read *,a,b
   cnt(a) = cnt(a) + int(b,kind=8)
enddo

do i = 1, 100000
   k = k - cnt(i)
   if (k <= 0) then
      print '(i0)',i
      exit
   endif
enddo
end	