itertools.product with nested loop