
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
A sequence \( a_1, a_2, \cdots, a_n, \cdots \) is defined such that \( S(a_i) \) denotes the sum of all digits of \( a_i \). For example, \( S(22) = 2 + 2 = 4 \). Given \( a_1 = 2017 \), \( a_2 = 22 \), and \( a_n = S(a_{n-1}) + S(a_{n-2}) \), find the value of \( a_{2017} \).

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