<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def path(self):
 """Iterate over all parent nodes and one-self."""

        yield self
        if not self.parent: return
        for node in self.parent.path: yield node