from itertools import accumulate

from bisect import bisect_left



N, K = [int(i) for i in input().split()]



memo = [0] * 100010

for _ in range(N):

    a, b = [int(i) for i in input().split()]

    memo[a] += b



print((bisect_left(list(accumulate(memo)), K)))
from sys import stdin

input = stdin.readline



from itertools import accumulate

from bisect import bisect_left



N, K = [int(i) for i in input().split()]



memo = [0] * 100010

for _ in range(N):

    a, b = [int(i) for i in input().split()]

    memo[a] += b



print((bisect_left(list(accumulate(memo)), K)))
from itertools import accumulate
from bisect import bisect_left

N, K = [int(i) for i in input().split()]
memo = [0] * 100010
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    memo[a] += b
print((bisect_left(list(accumulate(memo)), K)))

from sys import stdin

input = stdin.readline
from itertools import accumulate
from bisect import bisect_left

N, K = [int(i) for i in input().split()]
memo = [0] * 100010
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    memo[a] += b
print((bisect_left(list(accumulate(memo)), K)))

+from sys import stdin + +input = stdin.readline