You are looking for the product of the three lists; using itertools.product()
lets you collapse the three nested loops to:
from itertools import product
for a, b, c in product(A, B, C):
Because A == B == C
here, you could simplify that further to:
for a, b, c in product(A, repeat=3):
If you have multiple lists to produce a product of, put them in a list so you can produce the product of a variable number of input lists:
lists = [A, B, C, D, E]
for combination in product(*lists):