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

x = sorted([list(map(int,input().split())) for i in range(n)])

for i,j in x:

    k -= j

    if k<=0:

        print(i)

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

ab = [list(map(int,input().split())) for i in range(n)]

ab.sort()

b = [0]

for i in ab:

    b.append(b[-1]+i[1])

i = 0

while b[i]<k:

    i += 1

print((ab[i-1][0]))
n, k = list(map(int, input().split()))
x = sorted([list(map(int, input().split())) for i in range(n)])
for i, j in x:
    k -= j
    if k <= 0:
        print(i)
        exit()

n, k = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort()
b = [0]
for i in ab:
    b.append(b[-1] + i[1])
i = 0
while b[i] < k:
    i += 1
print((ab[i - 1][0]))

-x = sorted([list(map(int, input().split())) for i in range(n)]) -for i, j in x: -    k -= j -    if k <= 0: -        print(i) -        exit() +ab = [list(map(int, input().split())) for i in range(n)] +ab.sort() +b = [0] +for i in ab: +    b.append(b[-1] + i[1]) +i = 0 +while b[i] < k: +    i += 1 +print((ab[i - 1][0]))