Cartesian Product in mathematics When using the cartesian product, and you have three collections, do you take two collections at a time OR all three together to calculate the product?
My question is if you have more than two collections, let's say A, B and C
A = {1,2,3}
B = {4,5,6}
C = {7,8}

A x B x C
{1,2,3} x {4,5,6} x {7,8}

Do you with the cartesian product calculate A x B, then B x C? And maybe A x C? Which means you take only two collections at a time.
OR
Do you take all three collections at the same time A x B x C?

For $n \in \mathbb{N}$, the $n$-ary Cartesian product of $n$ sets $A_1, \dots, A_n$, denoted $A_1 \times \cdots \times A_n$, is defined to be the set of all $n$-tuples $(a_1, \dots, a_n)$ for which $a_i \in A_i$ for each $i$.
So in particular
$$A \times B \times C = \{ (a,b,c)\, :\, a \in A,\ b \in B,\ c \in C \}$$
This is distinct from
$$(A \times B) \times C = \{ ((a,b),c)\, :\, a \in A,\ b \in B,\ c \in C \}$$
each of whose elements is an ordered pair, the first 'coordinate' of which is itself an ordered pair.
Nonetheless, there is a very natural bijection
$$\begin{align}
A \times B \times C & \to (A \times B) \times C \\
(a,b,c) &\mapsto ((a,b),c) \end{align}$$
and similarly for $A \times (B \times C)$.
