def flatten(input_dict, separator="/", prefix=""):
    """
    Flattens a dictionary with nested dictionaries and lists
    into a single dictionary.

    The key compression is done using the chosen separator.
    """
    output_dict = {}

    def step(member, parent_key=""):
        if isinstance(member, dict):
            for key, value in member.items():
                step(
                    value,
                    f"{parent_key}{separator}{key}"
                    if parent_key
                    else str(key),
                )

        elif isinstance(member, list):
            for index, sublist in enumerate(member, start=0):
                step(
                    sublist,
                    f"{parent_key}{separator}{index}"
                    if parent_key
                    else str(index),
                )
        else:
            output_dict[f"{parent_key}"] = member

    step(input_dict)

    return output_dict