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

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

t = 0



while K>0:

    K-=s[t][1]

    t+=1



print((s[t-1][0]))
N,K = list(map(int,input().split()))

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

tot = 0



for n in range(N):

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

  num[a]+=b 



for n in range(10**5+1):

  tot+=num[n]

  if K<=tot:

    print(n)

    break
N, K = list(map(int, input().split()))
s = sorted([list(map(int, input().split())) for i in range(N)])
t = 0
while K > 0:
    K -= s[t][1]
    t += 1
print((s[t - 1][0]))

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

-s = sorted([list(map(int, input().split())) for i in range(N)]) -t = 0 -while K > 0: -    K -= s[t][1] -    t += 1 -print((s[t - 1][0])) +num = (10**5 + 1) * [0] +tot = 0 +for n in range(N): +    a, b = list(map(int, input().split())) +    num[a] += b +for n in range(10**5 + 1): +    tot += num[n] +    if K <= tot: +        print(n) +        break