from typing import List


def reconstruct_path(ancestor, node, source) -> List[str]:
    """Reconstruct the shortest path
    :param ancestor: list of ancestor for each node
    :param node: node from which the path is rebuilt
    :param source: the starting node
    :return: the path as a string list
    """
    total_path = [node.name]

    while node.name != source:
        node = ancestor[node]
        total_path.append(node.name)
    return total_path[::-1]