5. For which $a$ does the system

$$
\left\{\begin{array}{c}
(x-5) \sin a-(y-5) \cos a=0 \\
\left((x+1)^{2}+(y+1)^{2}-4\right)\left((x+1)^{2}+(y+1)^{2}-16\right)=0
\end{array}\right.
$$

have three solutions?
Answer: $a=\frac{\pi}{4} \pm \arcsin \frac{\sqrt{2}}{6}+\pi n, n \in Z$