I'm not sure on how to do the Cartesian product of the 3rd set. But this is how I have done it not sure if I'm correct.
A = {0,1}
B = {1,2}
C = {0,1,2}
Calculate (A X B ) X C
A X B = { (0,1),(0,2),(1,1), (1,2) }
(A X B) X C = {(0,1,0) , (0,2,1) , (1,1,2) , (1,2,0) , (1,1,1), (1,2,2), (1,2,0), (1,2,1) }
Fix the first element of the first set, which is $0$. This alone generates the triplets:
$\{0,1,0\}, \{0,1,1\}, \{0,1,2\}, \{0,2,0\}, \{0,2,1\}, \{0,2,2\}$.
Keep going in this fashion. You should end up with a set that has (size of $A$) $\times$ (size of $B$) $\times$ (size of $C$) elements.