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

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



ab.sort()



t = 0

for i in range(n):

    t += ab[i][1]

    if t >= k:

        print((ab[i][0]))

        break

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

amax = 100000

cnt = [0 for _ in range(amax+1)]





for i in range(n):

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

    cnt[a] += b



for i in range(1, amax+1):

    if k <= cnt[i]:

        print(i)

        break

    k -= cnt[i]
n, k = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
t = 0
for i in range(n):
    t += ab[i][1]
    if t >= k:
        print((ab[i][0]))
        break

n, k = list(map(int, input().split()))
amax = 100000
cnt = [0 for _ in range(amax + 1)]
for i in range(n):
    a, b = list(map(int, input().split()))
    cnt[a] += b
for i in range(1, amax + 1):
    if k <= cnt[i]:
        print(i)
        break
    k -= cnt[i]

-ab = [list(map(int, input().split())) for _ in range(n)] -ab.sort() -t = 0 +amax = 100000 +cnt = [0 for _ in range(amax + 1)] -    t += ab[i][1] -    if t >= k: -        print((ab[i][0])) +    a, b = list(map(int, input().split())) +    cnt[a] += b +for i in range(1, amax + 1): +    if k <= cnt[i]: +        print(i) +    k -= cnt[i]