
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
The sequence $\{a_n\}$ has a first term of 23 and a common difference $d$ which is an integer. The first 6 terms of the sequence are positive, and starting from the 7th term, the terms become negative:  
(1) Find the common difference $d$ of this arithmetic sequence;  
(2) Let the sum of the first $n$ terms be $S_n$, find the maximum value of $S_n$;  
(3) When $S_n$ is positive, find the maximum value of $n$.

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