
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 positive integer \( n \geq 2 \) and non-negative real numbers \( x_{1}, x_{2}, \cdots, x_{n} \) such that \( \sum_{i=1}^{n} x_{i}^{2} = 1 \). Let \( M = \max \left\{ x_{1}, x_{2}, \cdots, x_{n} \right\} \). Find the maximum and minimum values of 
\[ 
S = n M^{2} + 2 \sum_{1 \leq i < j \leq n} x_{i} x_{j} 
\]

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