
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
Given a natural number \( a \), let \( S(a) \) represent the sum of its digits (for example, \( S(123) = 1 + 2 + 3 = 6 \) ). If a natural number \( n \) has all distinct digits, and \( S(3n) = 3S(n) \), what is the maximum value of \( n \)?

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