12. (1999 Henan Province Competition Question) Given the sequence $\left\{a_{n}\right\}$, where $a_{1}=1, a_{2}=2, a_{n} a_{n+1} a_{n+2}=a_{n}+a_{n+1}+$ $a_{n+2}$, and $a_{n+1} a_{n+2} \neq 1$, then $S_{1999}=\sum_{n=1}^{1999} a_{n}=$ $\qquad$.
12. (Iterative Elimination Method) From the given recurrence relation of the sequence, noticing the iteration, it is not hard to see that $\left\{a_{n}\right\}$ is a periodic sequence.

It is easy to find that $a_{3}=3$.
$$
\begin{array}{l}
\text { Also, } a_{n} a_{n+1} a_{n-2}=a_{n}+a_{n-1}+a_{n+2}, \\
a_{n+1} a_{n+2} a_{n-3}=a_{n+1}+a_{n-2}+a_{n+3}
\end{array}
$$
Subtracting (1) from (2) gives
$a_{n-3}-a_{n}=a_{n+1} a_{n-2}\left(a_{n+3}-a_{n}\right)$.
That is, $\left(a_{n-3}-a_{n}\right)\left(a_{n+1} a_{n+2}-1\right)=0$.
Since $a_{n-1} a_{n+2} \neq 1$,
it follows that $a_{n+3}=a_{n}$.
Thus, 3 is a period of $\left\{a_{n}\right\}$.
Since $a_{1}+a_{2}+a_{3}=6,1999=1(\bmod 3)$,
it follows that $S_{1999}=\sum_{n=1}^{1959} a_{n}=6 \times 666+1=3997$.