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



ans = 0

m = 0

ab = []

for i in range(N):

    ab.append(list(map(int,input().split())))



ab.sort()



tmp = 0

for a,b in ab:

    tmp += b

    if tmp >= K:

        print(a)

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

n = [0]*(int(1e5)+1)



for i in range(N):

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

    n[a] += b



for i in range(int(1e5)+1):

    K -= n[i]

    if K <= 0:

        print(i)

        break
N, K = list(map(int, input().split()))
ans = 0
m = 0
ab = []
for i in range(N):
    ab.append(list(map(int, input().split())))
ab.sort()
tmp = 0
for a, b in ab:
    tmp += b
    if tmp >= K:
        print(a)
        break

N, K = list(map(int, input().split()))
n = [0] * (int(1e5) + 1)
for i in range(N):
    a, b = list(map(int, input().split()))
    n[a] += b
for i in range(int(1e5) + 1):
    K -= n[i]
    if K <= 0:
        print(i)
        break

-ans = 0 -m = 0 -ab = [] +n = [0] * (int(1e5) + 1) -    ab.append(list(map(int, input().split()))) -ab.sort() -tmp = 0 -for a, b in ab: -    tmp += b -    if tmp >= K: -        print(a) +    a, b = list(map(int, input().split())) +    n[a] += b +for i in range(int(1e5) + 1): +    K -= n[i] +    if K <= 0: +        print(i)