
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
Find the maximum value of $n$ such that there exists an arithmetic sequence $a_{1}, a_{2}, \cdots, a_{n} (n \geqslant 3)$ satisfying
$$
\sum_{i=1}^{n}\left|a_{i}\right|=\sum_{i=1}^{n}\left|a_{i}+1\right|=\sum_{i=1}^{n}\left|a_{i}-2\right|=507.
$$

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