• + 0 comments
    if __name__ == '__main__':
        # Store the names and scores in a list
        students = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            students.append([name, score])
        
        # Sort the list of students based on scores
        students.sort(key=lambda x: x[1])
        
        #assign the the second lowest value to a variable
        second_lowest_score = None
        for student in students:
            if second_lowest_score is None:
                second_lowest_score = student[1]
            elif student[1] > second_lowest_score:
                second_lowest_score = student[1]
                break
        
        # Create a list for names of students with the second lowest score
        second_lowest_names = []
        
        # Find the names corresponding to the second lowest score and add them to the list
        for student in students:
            if student[1] == second_lowest_score:
                second_lowest_names.append(student[0])
        
        # Sort the list of names alphabetically
        second_lowest_names.sort()
        
        # Print the names from the list of names with the second lowest score
        for name in second_lowest_names:
            print(name)