<filename>itertools/product.py
# Importing product from itertools
from itertools import product
# Reading two input lists
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# Finding the cartesian product
C = list(product(A, B))
# Printing the List elements with space separated 
print(*C)
<filename>itertools/product.py
# Importing product from itertools
from itertools import product
# Reading two input lists
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# Finding the cartesian product
C = list(product(A, B))
# Printing the List elements with space separated 
print(*C)
# Importing product from itertools # Reading two input lists # Finding the cartesian product # Printing the List elements with space separated