hope this fix your issue If I interpreted your text correctly, the following code should be what you are looking for:

```
import itertools
set1 = [1,2,3]
set2 = [4,5]
for i in itertools.permutations(set1, 2):
for j in itertools.permutations(set2, 2):
print("({},{},{},{})".format(i[0], j[0], j[1], i[1]))
```

```
(1,4,5,2)
(1,5,4,2)
(1,4,5,3)
(1,5,4,3)
(2,4,5,1)
(2,5,4,1)
(2,4,5,3)
(2,5,4,3)
(3,4,5,1)
(3,5,4,1)
(3,4,5,2)
(3,5,4,2)
```

```
p1 = itertools.permutations(set1, 2)
p2 = itertools.permutations(set2, 2)
for i in itertools.product(p1, p2):
print(i[0][0], i[1][0], i[1][1], i[0][1])
```