Given n nodes, and a list of steps, start at node 0, take the first step, then the second, and so on. Stop once you reach node 0 again, on the last step in the list.

Running...