• + 0 comments
    if __name__ == '__main__':
        records = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            records.append([name, score])
    
        # Step 2: Extract grades and find second lowest unique grade
        grades = sorted(set([score for name, score in records]))  # Get unique grades and sort them
        
        # Step 3: Get the second lowest grade
        second_lowest = grades[1]  # The second unique grade
        
        # Step 4: Collect names of students with the second lowest grade
        second_lowest_students = [name for name, score in records if score == second_lowest]
        
        # Step 5: Sort names alphabetically
        second_lowest_students.sort()
        
        # Step 6: Print the names of students with the second lowest grade
        for student in second_lowest_students:
            print(student)