This is a solution to an Abstract Algebra question but I don't understand the steps to the solution. It looks like some steps were jumped. I understand that $(Z,⊗)$ must be associative in order to be a semi-group. So in the first equation, $(xy + c(x + y + c^2 - c)$ is multiplied by z to give $xyz + cxz + cyz + c^2z - cz$ but then I don't get where the rest of the equation came from.

(source: gyazo.com)
Same goes for the second equation.
Can someone please explain how the long equation came about?
The expression is not multiplied in the usual sense, but `multiplied' using the operation $\otimes$ defined above. Furthermore, the text proves $(\mathbb{Z},\otimes)$ to be a semigroup rather than $(\mathbb{Z},+)$.