27 Given the function $f(n)$ defined on the set of natural numbers, satisfying
$$
f(n)=\left\{\begin{array}{ll}
n-12 & \text { when } n>2000 \text { } \\
f(f(n+16)) & \text { when } n \leqslant 2000 \text { }
\end{array}\right.
$$
(i) Find $f(n)$.
(ii) Find all solutions to the equation $f(n)=n$.