def find_reachable_cities(
        distances: dict[str, dict[str, float]]
    ) -> dict[str, set]:
    """
    Find all reachable cities from each city in a connectivity graph.

    The graph is represented by a dictionary where each key is a city and its
    value is a dictionary of directly connected cities and the distances to them.

    TIP: Use the depth-first search (DFS) algorithm:
        https://en.wikipedia.org/wiki/Depth-first_search

    Parameters
    ----------
    distances : dict[str, dict[str, float]]
        A dictionary representing the connectivity graph. Each connected city
        also appears as a key, with an empty dictionary if it has no outgoing
        connections.

    Returns
    -------
    dict[str, set]
        A dictionary where each key is a city, and the value is a set of
        cities that can be reached from that city. The set does not include
        the city itself (i.e., the starting city).

    Examples
    --------
    >>> distances = {
    ...    'CityA': {'CityB': 10, 'CityC': 20},
    ...    'CityB': {'CityC': 30},
    ...    'CityC': {'CityA': 40}
    ... }
    >>> find_reachable_cities(distances)
    {'CityA': {'CityB', 'CityC'}, 'CityB': {'CityA', 'CityC'}, 'CityC': {'CityB', 'CityA'}}
    """
    raise NotImplementedError("Complete this function.")
