from sys import stdin

input = stdin.readline



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

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

for _ in range(N):

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

    arr[a] += b



remain = K

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

    if arr[i] != 0:

        remain -= arr[i]

    if remain <= 0:

        print(i)

        exit()
import sys

from collections import defaultdict



n, k, *ab = list(map(int, sys.stdin.read().split()))

ab = list(zip(*[iter(ab)] * 2))



def main():

    cnt = defaultdict(int)

    for a, b in ab:

        cnt[a] += b

    

    s = 0

    for v, c in sorted(cnt.items()):

        s += c

        if s >= k:

            return v



if __name__ == '__main__':

    ans = main()

    print(ans)
from sys import stdin

input = stdin.readline
N, K = [int(x) for x in input().split()]
arr = [0] * (10**5 + 1)
for _ in range(N):
    a, b = [int(x) for x in input().split()]
    arr[a] += b
remain = K
for i in range(1, 10**5 + 1):
    if arr[i] != 0:
        remain -= arr[i]
    if remain <= 0:
        print(i)
        exit()

import sys
from collections import defaultdict

n, k, *ab = list(map(int, sys.stdin.read().split()))
ab = list(zip(*[iter(ab)] * 2))


def main():
    cnt = defaultdict(int)
    for a, b in ab:
        cnt[a] += b
    s = 0
    for v, c in sorted(cnt.items()):
        s += c
        if s >= k:
            return v


if __name__ == "__main__":
    ans = main()
    print(ans)

-from sys import stdin +import sys +from collections import defaultdict -input = stdin.readline -N, K = [int(x) for x in input().split()] -arr = [0] * (10**5 + 1) -for _ in range(N): -    a, b = [int(x) for x in input().split()] -    arr[a] += b -remain = K -for i in range(1, 10**5 + 1): -    if arr[i] != 0: -        remain -= arr[i] -    if remain <= 0: -        print(i) -        exit() +n, k, *ab = list(map(int, sys.stdin.read().split())) +ab = list(zip(*[iter(ab)] * 2)) + + +def main(): +    cnt = defaultdict(int) +    for a, b in ab: +        cnt[a] += b +    s = 0 +    for v, c in sorted(cnt.items()): +        s += c +        if s >= k: +            return v + + +if __name__ == "__main__": +    ans = main() +    print(ans)