def maybe_replace_node(n: Node) -> Node:
    if (n == self):
        return replace_with
    else:
        return n
def maybe_replace_node(n: Node) -> Node:
    if (n == self):
        return replace_with
    else:
        return n