import numpy as np



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

z = np.zeros(10**5 + 1)

for i in range(n):

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

  z[a] += b



a = 0

for i in range(1, 10**5 + 1):

  if k <= z[i]:

    a = i

    break

  k -= z[i]



print((int(a)))

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

d = {}

for i in range(n):

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

  d[a] = d[a] + b if a in d else b

 

a = 0

for i in range(1, 10**5+1):

  if i in d and k <= d[i]:

    a = i

    break

  k -= d[i] if i in d else 0

 

print(a)
import numpy as np

n, k = list(map(int, input().split()))
z = np.zeros(10**5 + 1)
for i in range(n):
    a, b = list(map(int, input().split()))
    z[a] += b
a = 0
for i in range(1, 10**5 + 1):
    if k <= z[i]:
        a = i
        break
    k -= z[i]
print((int(a)))

n, k = list(map(int, input().split()))
d = {}
for i in range(n):
    a, b = list(map(int, input().split()))
    d[a] = d[a] + b if a in d else b
a = 0
for i in range(1, 10**5 + 1):
    if i in d and k <= d[i]:
        a = i
        break
    k -= d[i] if i in d else 0
print(a)

-import numpy as np - -z = np.zeros(10**5 + 1) +d = {} -    z[a] += b +    d[a] = d[a] + b if a in d else b -    if k <= z[i]: +    if i in d and k <= d[i]: -    k -= z[i] -print((int(a))) +    k -= d[i] if i in d else 0 +print(a)