def normalize_path(path: str) -> str:
    """
    Normalize path.

    Converts
        # -> root
        ^ -> parent
        ^^ -> parent.parent
    """
    if not path.startswith('$'):
        return path

    path = path[1:]
    if path.startswith('#'):
        return 'root.' + path[1:]

    for i, value in enumerate(path):
        if value != '^':
            return 'parent.' * i + path[i:]
    return ('parent.' * len(path))[:-1]