Let $P=X^{3}-3 X^{2}-1$. Calculate the sum of the cubes of the roots (real or complex) of $P$.

Soit $P=X^{3}-3 X^{2}-1$. Calculer la somme des cubes des racines (réelles ou complexes) de $P$.

The translation is provided while keeping the original text's line breaks and format. However, the second line is a repetition of the original French text, which I have left unchanged. If you need the second line to be in English as well, please let me know.
Let $r_{1}, r_{2}, r_{3}$ be these roots. Then by Viète's formulas:

$$
\begin{array}{rlr}
\sum_{i=1}^{3} r_{i}^{3} & = & \sum_{i=1}^{3}\left(3 r_{i}^{2}+1\right) \\
& = & 3 \cdot\left(\sum_{i=1}^{3} r_{i}^{2}\right)+3 \\
& = & 3 \cdot\left(\sum_{i=1}^{3} r_{i}\right)^{2}-2\left(r_{1} r_{2}+r_{1} r_{3}+r_{2} r_{3}\right)+3 \\
& = & 3 \cdot 3^{2}-2 \cdot 0+3=30
\end{array}
$$