def find_pairs_to_remove(cycle, preferences):
    """ Find all cycle pairs to remove from each participant's preference lists.
        Takes in a list of tuples representing a cycle path found and
        dictionary containing each participant's preferences.
        Returns list of tuples representing pairs to remove.

        For example:
        Input of
            cycle = [('D', 'B'), ('A', 'C')]
            preferences = {
                'A': ['C', 'B'],
                'B': ['A', 'C', 'D'],
                'C': ['D', 'B', 'A'],
                'D': ['B', 'C']
            }

        where participant = 'B'
            participant_prefs = ['A', 'C', 'D']
            first_pref = 'A'
            successors = ['C', 'D']

        Output =>
            pairs = [('B', 'C'), ('B', 'D'), ('C', 'A')]
    """
    pairs = []
    for i, (_, participant) in enumerate(cycle):
        # grab the preference list for participant
        participant_prefs = preferences[participant]
        # first_pref is a pointer for where to start successors list
        first_pref = cycle[(i - 1) % len(cycle)][0]
        # successors is the tail of the cycle which needs to be removed
        successors = participant_prefs[participant_prefs.index(
            first_pref) + 1:]
        # breakpoint()

        for successor in successors:
            pair = (participant, successor)
            if pair not in pairs and pair[::-1] not in pairs:
                pairs.append((participant, successor))
    return pairs