
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 triangle $\triangle ABC$ with area $S$, and its sides $a$, $b$, $c$ opposite to angles $A$, $B$, $C$ respectively. If $4S + a^2 = b^2 + c^2$, find the maximum value of $\sin C - \cos(B + \frac{\pi}{4})$ and the value of $C$ when it reaches the maximum.

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