Here is my code
N = namedtuple(\"N\", [\'ind\', \'set\', \'v\']) def solve() items=[] stack=[] R = set(range(0,8)) for i in range(0,8):
items[node.ind] = items[node.ind]._replace(v=node.v)
(Note: Don't be discouraged to use this solution because of the leading underscore in the function _replace. Specifically for namedtuple some functions have leading underscore which is not for indicating they are meant to be "private")