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

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

A.sort()

for i in range(N):

    if K>A[i][1]:

      K -= A[i][1]

    else:

      ans = A[i][0]

      break

print(ans)
def solve():

  ans = 0

  cnt = 0

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

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

  A.sort()

  for a,b in A:

    cnt += b

    if cnt>=K:

      ans = a

      break

  return ans

print((solve()))
N, K = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
A.sort()
for i in range(N):
    if K > A[i][1]:
        K -= A[i][1]
    else:
        ans = A[i][0]
        break
print(ans)

def solve():
    ans = 0
    cnt = 0
    N, K = list(map(int, input().split()))
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for a, b in A:
        cnt += b
        if cnt >= K:
            ans = a
            break
    return ans


print((solve()))

-N, K = list(map(int, input().split())) -A = [list(map(int, input().split())) for _ in range(N)] -A.sort() -for i in range(N): -    if K > A[i][1]: -        K -= A[i][1] -    else: -        ans = A[i][0] -        break -print(ans) +def solve(): +    ans = 0 +    cnt = 0 +    N, K = list(map(int, input().split())) +    A = [list(map(int, input().split())) for _ in range(N)] +    A.sort() +    for a, b in A: +        cnt += b +        if cnt >= K: +            ans = a +            break +    return ans + + +print((solve()))