
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
In the sequence $\{a_n\}$, $a_1=-2$, $a_2=3$, $a_3=4$, and $a_{n+3}+(-1)^{n}a_{n+1}=2$. Let $S_n$ be the sum of the first $n$ terms of the sequence $\{a_n\}$. Then, $S_{40}=$ ______.

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