For integers $n$, let \[f(n) = \left\{
\begin{array}{cl}
n^2 + 1 & \text{ if }n\text{ is odd}, \\
n^2 - 3n + 1 & \text{ if }n\text{ is even}.
\end{array}
\right.\]Find $f(f(f(f(f(f(2))))))$.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
For integers $n$, let \[f(n) = \left\{
\begin{array}{cl}
n^2 + 1 & \text{ if }n\text{ is odd}, \\
n^2 - 3n + 1 & \text{ if }n\text{ is even}.
\end{array}
\right.\]Find $f(f(f(f(f(f(2))))))$.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
For integers $n$, let \[f(n) = \left\{
\begin{array}{cl}
n^2 + 1 & \text{ if }n\text{ is odd}, \\
n^2 - 3n + 1 & \text{ if }n\text{ is even}.
\end{array}
\right.\]Find $f(f(f(f(f(f(2))))))$.
train