
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 $m > 1$ be an integer. A sequence $a_{1}, a_{2}, \cdots$ is defined as follows:
$$
\begin{array}{l}
a_{1}=a_{2}=1, a_{3}=4, \\
a_{n}=m\left(a_{n-1}+a_{n-2}\right)-a_{n-3} \quad (n \geq 4).
\end{array}
$$

Determine all integers $m$ such that each term in the sequence is a perfect square.

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