4. If $\sin x \sin 2 x \sin 3 x+\cos x \cos 2 x \cos 3 x=1$, then $x=$
$$
\begin{array}{l}
\text { Since }|\sin x \sin 2 x \sin 3 x+\cos x \cos 2 x \cos 3 x| \\
\leqslant|\sin x \sin 2 x \sin 3 x|+|\cos x \cos 2 x \cos 3 x| \leqslant|\sin x \sin 2 x|+|\cos x \cos 2 x| \\
\leqslant \max \{|\cos x|,|\cos 3 x|\} \leqslant 1 \text {, equality holds when }|\cos x|=1 \text {. Therefore, } x=k \pi(k \in \mathbf{Z}) \text {. }
\end{array}
$$