307. Given two equations:

$$
x^{2}+a x+1=0, \quad x^{2}+x+a=0
$$

Determine all values of the coefficient $a$, for which these equations have at least one common root.
307. First solution. Let's find the coefficient $a$ from the second equation and substitute it into the first equation. Then we get:

$$
\begin{array}{r}
a=-(x^{2}+x) \\
x^{2}-(x^{2}+x) x+1=0 \\
x^{3}-1=0 \\
(x-1)\left(x^{2}+x+1\right)=0
\end{array}
$$

From this, we have:

$$
x_{1}=1, \quad x_{2,3}=\frac{-1 \pm i \sqrt{3}}{2}
$$

and, consequently, since $a=-(x^{2}+x)$, then $a_{1}=-2, a_{2,3}=1$.

Second solution. Using the result of problem 306, we can assert that for our equations to have at least one common root, it is necessary and sufficient for the expression

$$
\begin{aligned}
a^{2}+1-a \cdot 1(a+1)+1+a^{3}-2 a=a^{3}-3 a+2 & = \\
=(a-1)\left(a^{2}+a-2\right) & =(a-1)^{2}(a+2)
\end{aligned}
$$

to be zero. From this, we get:

$$
a_{1}=-2, a_{2,3}=1
$$