• + 0 comments
    if __name__ == '__main__':
        alist=[]
        for _ in range(int(input())):
            name = input()
            score = float(input())
            alist.append([name,score])
    second_highest = sorted(set([marks for name, marks in alist]))[1]
    print('\n'.join([a for a,b in sorted(alist) if b == second_highest]))