def get_terminal_nodes(dag: dict) ->[str]:
    """Yield terminal nodes of given dag, with doublons.
    Key None must be associated with roots
    """
    roots = list(dag[None])
    while roots:
        root = roots.pop()
        if root in dag and dag[root]:
            for sub in dag[root]:
                roots.append(sub)
        else:
            yield root
