4. Find all non-negative real solutions $\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ of the system of equations

$$
x_{i+1}=x_{i}^{2}-\left(x_{i-1}-1\right)^{2}, \quad i=1,2, \ldots, n
$$

(Indices are taken cyclically modulo $n$.)