• + 0 comments
    if __name__ == '__main__':
        students = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            students.append([name, score])
        sorted_arr = sorted(students,key=lambda item: (item[1], item[0]))
        lowest_score = sorted_arr[0][1]
        second_lowest_score = -1
        for i in range( len(sorted_arr)-1):
            if (sorted_arr[i][1] != sorted_arr[i+1][1]) & (second_lowest_score == -1):
                second_lowest_score = sorted_arr[i+1][1]
                print(sorted_arr[i+1][0])
            elif sorted_arr[i+1][1] == second_lowest_score:
                print(sorted_arr[i+1][0])