
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Let $\mathrm{A}$ be a set of $n$ elements $(n \geqslant 3)$. When $f(x)$ is a mapping from $A$ to $A$, it is defined that: $f^{2}(x)=f(f(x))$, $f^{i+1}(x)=f\left(f^{i}(x)\right), i=2,3, \cdots$. Find the number of mappings $f$ from $A$ to $A$ such that $f^{n-2}(x)$ is a constant while $f^{n}(x)$ is not a constant.

Present the answer in LaTex format: \boxed{Your answer}
user