[python3] Use itertools for cartesian product