program main
	implicit none
	integer(8) N, K, i, S
	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
	S = 0
	do i = 1, N
		S = S + b(i)
		if(K <= S) then
			write(*, *) a(i)
			exit
		end if
	end do
end program main