Let $a,$ $b,$ $c$ be the roots of
\[x^3 - 6x^2 + 3x + 1 = 0.\]Find all possible values of $a^2 b + b^2 c + c^2 a.$  Enter all possible values, separated by commas.
By Vieta's formulas,
\begin{align*}
a + b + c &= 6, \\
ab + ac + bc &= 3, \\
abc &= -1.
\end{align*}Let $p = a^2 b + b^2 c + c^2 a$ and $q = ab^2 + bc^2 + ca^2.$  Then
\[p + q = a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2.\]Note that
\[(a + b + c)(ab + ac + bc) = a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2 + 3abc,\]so
\begin{align*}
a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2 &= (a + b + c)(ab + ac + bc) - 3abc \\
&= (6)(3) - 3(-1) \\
&= 21.
\end{align*}Also,
\[pq = a^3 b^3 + a^3 c^3 + b^3 c^3 + a^4 bc + ab^4 c + abc^4 + 3a^2 b^2 c^2.\]To obtain the terms $a^3 b^3 + a^3 c^3 + b^3 c^3,$ we can cube $ab + ac + bc$:
\begin{align*}
(ab + ac + bc)^3 &= a^3 b^3 + a^3 c^3 + b^3 c^3 \\
&\quad + 3(a^3 b^2 c + a^3 bc^2 + a^2 b^3 c + a^2 bc^3 + ab^3 c^2 + ab^2 c^3) \\
&\quad + 6a^2 b^2 c^2.
\end{align*}Now,
\begin{align*}
&a^3 b^2 c + a^3 bc^2 + a^2 b^3 c + a^2 bc^3 + ab^3 c^2 + ab^2 c^3 \\
&= abc (a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2) \\
&= (-1)(21) = -21,
\end{align*}so
\begin{align*}
a^3 b^3 + a^3 c^3 + b^3 c^3 &= (ab + ac + bc)^3 - 3(-21) - 6a^2 b^2 c^2 \\
&= 3^3 - 3(-21) - 6(-1)^2 \\
&= 84.
\end{align*}Also,
\[a^4 bc + ab^4 c + abc^4 = abc(a^3 + b^3 + c^3).\]To obtain the terms $a^3 + b^3 + c^3,$ we can cube $a + b + c$:
\[(a + b + c)^3 = a^3 + b^3 + c^3 + 3(a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2) + 6abc,\]so
\begin{align*}
a^3 + b^3 + c^3 &= (a + b + c)^3 - 3(a^2 b + ab^2 + a^2 c + ac^2 + b^2 c + bc^2) - 6abc \\
&= 6^3 - 3(21) - 6(-1) \\
&= 159.
\end{align*}Hence,
\begin{align*}
pq &= a^3 b^3 + a^3 c^3 + b^3 c^3 + a^4 bc + ab^4 c + abc^4 + 3a^2 b^2 c^2 \\
&= 84 + (-1)(159) + 3(-1)^2 \\
&= -72.
\end{align*}Then by Vieta's formulas, $p$ and $q$ are the roots of
\[x^2 - 21x - 72 = (x - 24)(x + 3) = 0.\]Thus, the possible values of $p$ (and $q$) are $\boxed{24,-3}.$