Dynamic Programming / Path Printing