# -*- coding: utf-8 -*-

"""

Created on Mon Sep 28 01:14:47 2020



@author: liang

"""



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

A = list()

for i in range(N):

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

    A.append((a,b))

A.sort(key= lambda x:x[0])



tmp = 0

for i in range(N):

    a, b = A[i]

    tmp += b

    if tmp >= K:

        print(a)

        break

# -*- coding: utf-8 -*-

"""

Created on Mon Sep 28 01:21:16 2020



@author: liang

"""



#バケツソートO(n)

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

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

for i in range(N):

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

    num[a] += b



tmp = 0

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

    tmp += num[i]

    if tmp >= K:

        print(i)

        break
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 01:14:47 2020
@author: liang
"""
N, K = list(map(int, input().split()))
A = list()
for i in range(N):
    a, b = list(map(int, input().split()))
    A.append((a, b))
A.sort(key=lambda x: x[0])
tmp = 0
for i in range(N):
    a, b = A[i]
    tmp += b
    if tmp >= K:
        print(a)
        break

# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 01:21:16 2020
@author: liang
"""
# バケツソートO(n)
N, K = list(map(int, input().split()))
num = [0] * (10**5 + 1)
for i in range(N):
    a, b = list(map(int, input().split()))
    num[a] += b
tmp = 0
for i in range(10**5 + 1):
    tmp += num[i]
    if tmp >= K:
        print(i)
        break

-Created on Mon Sep 28 01:14:47 2020 +Created on Mon Sep 28 01:21:16 2020 +# バケツソートO(n) -A = list() +num = [0] * (10**5 + 1) -    A.append((a, b)) -A.sort(key=lambda x: x[0]) +    num[a] += b -for i in range(N): -    a, b = A[i] -    tmp += b +for i in range(10**5 + 1): +    tmp += num[i] -        print(a) +        print(i)