Generate a list from linear combination in simpy

I am using sympy to do some calculations, but I need to manipulate results of multiplications using rules I have to define. Let us suppose I have

a, b, c, d = symbols('a b c d', commutative=False)
res = a*b + b*c + c*d

I was wondering how can I write a function which takes res and gives a list of this kind


since every time I try to perform operations like list(res) python throws the exception Mul (Add) object is not iterable. Thanks in advance


This is a way:

[x.as_ordered_factors() for x in res.as_ordered_terms()]