9. (16 points) For a given positive integer $M$, define $f_{1}(M)$ as the square of the sum of the digits of $M$. When $n>1$ and $n \in \mathbf{N}$, $f_{n}\left(f_{n-1}(M)\right)$ represents the $r_{n}$-th power of the sum of the digits of $f_{n-1}(M)$, where, when $n$ is odd, $r_{n}=2$; when $n$ is even, $r_{n}=3$. Find the value of $f_{2012}\left(f_{2011}\left(3^{2010}\right)\right)$.
Let the positive integer $M=a_{1} a_{2} \cdots a_{m}$, where $a_{i} \in \mathbf{N}, a_{1}>0 (i=1,2, \cdots, m)$. Then
$$
f_{1}(M)=\left(a_{1}+a_{2}+\cdots+a_{m}\right)^{2} \equiv M^{2}(\bmod 9) .
$$

When $M=3^{2010}$, $f_{1}(M) \equiv M^{2} \equiv 0(\bmod 9)$.
By mathematical induction, it is easy to see that for $n \in \mathbf{N}$, and $n \geqslant 2$, we always have
$$
f_{n}\left(f_{n-1}(M)\right) \equiv 0(\bmod 9) .
$$

Since $3^{2010}=9^{1005}<10^{1005}$, the sum of its digits is less than $9 \times 1005=9045$.
Thus, $f_{1}\left(3^{2010}\right)<9045^{2}<9 \times 10^{7}$.
Therefore, the sum of the digits of $f_{1}\left(3^{2010}\right)$ is less than $9 \times 8=72$.
Hence, $f_{2}\left(f_{1}\left(3^{2010}\right)\right)<72^{3}<400000$, and $f_{3}\left(f_{2}\left(3^{2010}\right)\right)<(3+9 \times 5)^{2}=48^{2}<50^{2}$. Let the sum of the digits of $f_{3}\left(f_{2}\left(3^{2010}\right)\right)$ be $a$. Then $1 \leqslant a<1+9 \times 3=28$,

and $a \equiv f_{3}\left(f_{2}\left(3^{2010}\right)\right) \equiv 0(\bmod 9)$.
Therefore, $a \in\{9,18,27\}$.
Thus, $f_{4}\left(f_{3}\left(3^{2010}\right)\right)=a^{3} \in\left\{9^{3}, 18^{3}, 27^{3}\right\}$
$$
=\{729,5832,19683\} \text {. }
$$

The sums of the digits of $729$, $5832$, and $19683$ are $18$, $18$, and $27$, respectively. Hence,
$$
f_{5}\left(f_{4}\left(3^{2010}\right)\right) \in\left\{18^{2}, 27^{2}\right\}=\{324,729\} \text {. }
$$

Furthermore,
$$
\begin{array}{l}
f_{6}\left(f_{5}\left(3^{2010}\right)\right) \in\left\{9^{3}, 18^{3}\right\}=\{729,5832\} \\
\Rightarrow f_{7}\left(f_{6}\left(3^{2010}\right)\right)=18^{2}=324 \\
\Rightarrow f_{8}\left(f_{7}\left(3^{2010}\right)\right)=9^{3}=729 \\
\Rightarrow f_{9}\left(f_{8}\left(3^{2010}\right)\right)=18^{2}=324 \\
\Rightarrow \cdots \cdots \\
\Rightarrow f_{2012}\left(f_{2011}\left(3^{2010}\right)\right)=729
\end{array}
$$