Trying out itertools.permutations for p4