program main
   integer(8) N, K, i
   integer(8), allocatable :: a(:), b(:)
   read(*, *) N, K
   allocate(a(1: N))
   allocate(b(1: N))
   do i = 1, N
       read(*, *) a(i), b(i)
   end do
   do i = 1, N
       if(1 <= K .and. K <= b(i)) then
	       write(*, *) a(i)
	       exit
	   else
	       K = K - b(i)
	   end if
   end do
end program main