
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=8$, $a_4=2$, and it satisfies $a_{n+2}-2a_{n+1}+a_{n}=0$ $(n\in\mathbb{N}^*)$.

    $(1)$ Find the general formula for the sequence $\{a_n\}$;

    $(2)$ Let $S_n=|a_1|+|a_2|+\ldots+|a_n|$, find $S_n$.

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