Puzzle Node problems in Python