Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
_a = []
ans = 0
b = 0


for i in range(N):
    a, b = list(map(int, input().split()))
    _a.append([a, b])

_a.sort()
for i in range(N):
    buff += [_a[i][0]] * _a[i][1]

print(buff[K-1])



Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))

buff = []
a = []
ans = 0
b = 0
for i in range(N):
    _a, _b = list(map(int, input().split()))
    b += _b
    a.append((_a, _b))
    # if b >= K and ans == 0:
    #     ans = _a
    # buff += [_a]*_b


a = a.sort()

for i in range(N):
    buff += [a[i][0]] * a[i][1]

# buff = sorted(buff)
print(buff[K-1])


Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
__max = 10**5+1
buff = [0 for i in range(__max)]
a = []
ans = 0
b = 0
for i in range(N):
    _a, _b = list(map(int, input().split()))
    buff[_a] = _b


for i in range(1,__max+1):

    if K <= buff[i]:
        print(i)
        exit()

    K -= buff[i]


Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
__max = 10**5+1
buff = [0 for i in range(__max)]
a = []
ans = 0
b = 0
for i in range(N):
    _a, _b = list(map(int, input().split()))
    buff[_a] = _b


for i in range(1,__max+1):

    if K <= buff[i]:
        print(i)
        exit()

    K -= buff[i]

Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
a = []
ans = 0
b = 0
for i in range(N):
    _a, _b = list(map(int, input().split()))
    b += _b
    a.append((_a, _b))
    # if b >= K and ans == 0:
    #     ans = _a
    # buff += [_a]*_b


a = sorted(a)

for i in range(N):
    buff += [a[i][0]] * a[i][1]

# buff = sorted(buff)
print(buff[K-1])


# print(ans)


Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
a = []
ans = 0
b = 0
for i in range(N):
    _a, _b = list(map(int, input().split()))
    b += _b
    a.append((_a, _b))
    # if b >= K and ans == 0:
    #     ans = _a
    # buff += [_a]*_b


a = sorted(a)

for i in range(N):
    buff += [a[i][0]] * a[i][1]

# buff = sorted(buff)
print(buff[K-1])


# print(ans)


Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
a = []
for i in range(N):
    _a, _b = list(map(int, input().split()))
    buff += [_a]*_b


buff = sorted(buff)
print(buff[K-1])




Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
a = []
for i in range(N):
    _a, _b = list(map(int, input().split()))
    buff += [_a]*_b


buff = sorted(buff)
print(buff[K-1])



Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))

buff = []
a = []
b = []
for i in range(N):
    _a, _b = list(map(int, input().split()))
    a.append(_a)
    b.append(_b)
    buff += [_a]*_b


buff = sorted(buff)
print(buff[K-1])




Fixed submission:
amax = 100000
cnt = [0 for i in range(amax+1)]


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

for i in range(N):
    a, b = list(map(int, input().split()))
    cnt[a] += b


for ans in range(1, amax+1):
    if K <= cnt[ans]:
        print(ans)
        break
    K -= cnt[ans]