Add function to print the path to a given node.