Let $f(x) = x^3 + ax^2 + bx + c$ and $g(x) = x^3 + bx^2 + cx + a$, where $a, b, c$ are integers with $c \ne 0$.

Suppose that the following conditions hold:

$f(1) = 0$

the roots of $g(x)$ are squares of the roots of $f(x)$.

Find the value of $S=a^{2016}+b^{2016}+ c^{2016}$.