
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
Consider a finite sequence of four-digit integers where the hundreds, tens, and units digits of each term respectively become the thousands, hundreds, and tens digits of the next term, and the hundreds, tens, and units digits of the last term are, respectively, the thousands, hundreds, and tens digits of the first term. Let $S$ be the sum of all the terms in the sequence. Find the largest prime factor that always divides $S$.

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