class Node():

	def __init__(self, v, w):

		self._v = v

		self._w = w

	def v(self):

		return self._v

	def w(self):

		return self._w

def resolve():

	n, k = list(map(int, input().split()))

	arr = []

	for i in range(n):

		a, b = list(map(int, input().split()))

		arr.append(Node(a, b))

	arr.sort(key=lambda x: x.v())

	for v in arr:

		if v.w() >= k:

			print((v.v()))

			break

		k -= v.w()

resolve()
def resolve():

	n, k = list(map(int, input().split()))

	arr = [0]*(10**5+1)

	for i in range(n):

		a, b = list(map(int, input().split()))

		arr[a] += b

	for i in range(len(arr)):

		if arr[i] >= k:

			print(i)

			break

		k -= arr[i]

resolve()
class Node:
    def __init__(self, v, w):
        self._v = v
        self._w = w

    def v(self):
        return self._v

    def w(self):
        return self._w


def resolve():
    n, k = list(map(int, input().split()))
    arr = []
    for i in range(n):
        a, b = list(map(int, input().split()))
        arr.append(Node(a, b))
    arr.sort(key=lambda x: x.v())
    for v in arr:
        if v.w() >= k:
            print((v.v()))
            break
        k -= v.w()


resolve()

def resolve():
    n, k = list(map(int, input().split()))
    arr = [0] * (10**5 + 1)
    for i in range(n):
        a, b = list(map(int, input().split()))
        arr[a] += b
    for i in range(len(arr)):
        if arr[i] >= k:
            print(i)
            break
        k -= arr[i]


resolve()

-class Node: -    def __init__(self, v, w): -        self._v = v -        self._w = w - -    def v(self): -        return self._v - -    def w(self): -        return self._w - - -    arr = [] +    arr = [0] * (10**5 + 1) -        arr.append(Node(a, b)) -    arr.sort(key=lambda x: x.v()) -    for v in arr: -        if v.w() >= k: -            print((v.v())) +        arr[a] += b +    for i in range(len(arr)): +        if arr[i] >= k: +            print(i) -        k -= v.w() +        k -= arr[i]