• + 0 comments

    if name == 'main': list=[] second_lowest = int()

    for _ in range(int(input())):
        name = input()
        score = float(input())
        list.append([name, score])
    
    list.sort(key=lambda score: score[1])
    lowest = list[0][1]
    
    for name, score in list:
        if score > lowest:
            second_lowest = score
            break
    second_lowest_list = [name for name, score in list if score == second_lowest]
    second_lowest_list.sort()
    for name in second_lowest_list:
        print(name)