N, K = list(map(int, input().split()))



lst = []

for i in range(N):

    lst += [list(map(int, input().split()))]



lst.sort()





for i in range(N):

    if K <= lst[i][1]:

        print((lst[i][0]))

        exit()

    else:

        K -= lst[i][1]
import sys

input = sys.stdin.readline



N, K = list(map(int, input().split()))



AB = [tuple(map(int, input().split())) for _ in range(N)]



AB.sort(key = lambda x: x[0])





for a, b in AB:

    K -= b

    if K <= 0:

        print (a)

        exit()
N, K = list(map(int, input().split()))
lst = []
for i in range(N):
    lst += [list(map(int, input().split()))]
lst.sort()
for i in range(N):
    if K <= lst[i][1]:
        print((lst[i][0]))
        exit()
    else:
        K -= lst[i][1]

import sys

input = sys.stdin.readline
N, K = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[0])
for a, b in AB:
    K -= b
    if K <= 0:
        print(a)
        exit()

+import sys + +input = sys.stdin.readline -lst = [] -for i in range(N): -    lst += [list(map(int, input().split()))] -lst.sort() -for i in range(N): -    if K <= lst[i][1]: -        print((lst[i][0])) +AB = [tuple(map(int, input().split())) for _ in range(N)] +AB.sort(key=lambda x: x[0]) +for a, b in AB: +    K -= b +    if K <= 0: +        print(a) -    else: -        K -= lst[i][1]