12. Let the set $M=\{1,2,3,4,5,6,7,8,9,10\}, A=\left\{(x, y, z) \mid x, y, z \in M\right.$, and $\left.9 \mid\left(x^{3}+y^{3}+z^{3}\right)\right\}$, then the number of elements in set $A$ is $\qquad$.
Since $(3 k+1)^{3}=27 k^{3}+9 k(3 k+1)+1,(3 k-1)^{3}=27 k^{3}-9 k(3 k-1)-1$, then $(3 k \pm 1)^{3} \equiv \pm 1$ $(\bmod 9)$, so when $9 \mid\left(x^{3}+y^{3}+z^{3}\right)$, $x, y, z$ are all multiples of 3, or their remainders modulo 3 are $0,1,2$ each. Therefore, the number of elements in set $A$ is $3^{3}+6 \cdot 3 \cdot 4 \cdot 3=243$.