import itertools


def bsuccessors(state: tuple) -> dict:
    """Return a dictionary of {state:action} pairs.

    A state is a (here, there) tuple, where here and there are frozen sets of people
    indicated by their crossing times) and/or the 'light'.

    An action is represented as a tuple (person1, person2, arrow), where arrow is '->' for here to there
    and '<-' for there to here. When only one person crosses, person two will be the same as person one, so the
    action (2, 2, '->') means that the person with a travel time of 2 crossed from here to there alone.
    """
    here, there = state
    successors = dict()
    if 'light' in here:
        arrow = '->'
        reverse = False
    else:
        arrow = '<-'
        reverse = True
        here, there = there, here
    here = here.difference(['light'])
    there = there.union(['light'])
    for persons in itertools.product(here, repeat=2):
        next_here = here.difference(persons)
        next_there = there.union(persons)
        if not reverse:
            state = (next_here, next_there)
        else:
            state = (next_there, next_here)
        action = (persons[0], persons[1], arrow)
        successors[state] = action
    return successors