I'm looking at the solution manual of a book and it lists a solution for
$$[19^3\mod {23}]^2 \pmod {31} \equiv [(-4)^3\mod {23}]^2 \pmod {31} \equiv [-64\mod {23}]^2 \pmod {31}\equiv 5^2 \pmod{31} = 25$$
How does it get from $[19^3\mod {23}]^2 \pmod {31}$ to $[(-4)^3\mod {23}]^2 \pmod {31}$?
in other words where does the transformation from $19^3$ to $(-4)^3$ come from?