
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 integer \( n \) such that there exists a permutation \(\left(a_{1}, a_{2}, \cdots, a_{n}\right)\) of \(\{0, 1, 2, \cdots, n-1\}\) which satisfies that the sequence \(a_{1}, a_{1}a_{2}, a_{1}a_{2}a_{3}, \cdots, a_{1}a_{2}\cdots a_{n}\) exactly forms a complete system of residues modulo \( n \).

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