Buggy python submission (verdict: Time Limit Exceeded):
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    if a1 in l:
        #d[a1] += b1
        l[a1][1] += b1
    else:
        l.append( ( a1, b1 ))
        #//d[a1] = b1

l.sort()
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break

Buggy python submission (verdict: Time Limit Exceeded):
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    if a1 in l:
        d[a1] += b1
    else:
        l.append(a1)
        d[a1] = b1

l.sort()
count = 0
for item in l:
    count += d[item]
    if k <= count:
        print item
        break


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, raw_input().split(" "))

l = []
d = {}
for i in range(n):
    a1, b1 = map(int, raw_input().split(" "))
    if a1 in l:
        d[a1] += b1
    else:
        l.append(a1)
        d[a1] = b1

l.sort()
count = 0
for item in l:
    count += d[item]
    if k <= count:
        print item
        break


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, raw_input().split(" "))

d = {}
for i in range(n):
    a1, b1 = map(int, raw_input().split(" "))
    if a1 in d.keys():
        d[a1] += b1
    else:
        d[a1] = b1


count = 0
for item in sorted(d.items(), key=lambda x: x[0]) :
    count += item[1]
    if k <= count:
        print item[0]
        break
    #count += item[1]


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, raw_input().split(" "))

d = {}
for i in range(n):
    a1, b1 = map(int, raw_input().split(" "))
    if a1 in d.keys():
        d[a1] += b1
    else:
        d[a1] = b1


count = 0
for item in sorted(d.items(), key=lambda x: x[0]) :
    if k <= count + item[1]:
        print item[0]
        break
    count += item[1]


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, raw_input().split(" "))

d = {}
for i in range(n):
    a1, b1 = map(int, raw_input().split(" "))
    if a1 in d.keys():
        d[a1] += b1
    else:
        d[a1] = b1


l = sorted(d.items(), key=lambda x: x[0])
#print (l)
count = 0
for e, item in enumerate(l):
    if k <= count + item[1]:
        print item[0]
        break
    else:
        count += item[1]


Fixed submission:
line_one = raw_input().split()
n = int(line_one[0])
k = int(line_one[1])

l = []
#d = {}
for i in range(n):
    line_one2 = raw_input().split()
    a1 = int(line_one2[0])
    b1 = int(line_one2[1])
    l.append( ( a1, b1 ))
    #if a1 in l:
    #    #d[a1] += b1
    #    l[a1][1] += b1
    #else:
    #    l.append( ( a1, b1 ))
    #    #//d[a1] = b1

#l.sort()
l = sorted(l, key=lambda x: x[0])
count = 0
for item in l:
    count += item[1]
    if k <= count:
        print item[0]
        break