
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
Read the material:<br/>① Factorize using the completion of squares: $a^{2}+6a+8$.<br/>Solution: Original expression $=a^{2}+6a+9-1=\left(a+3\right)^{2}-1=\left(a+3-1\right)\left(a+3+1\right)=\left(a+2\right)\left(a+4\right)$.<br/>② If $M=a^{2}-2ab+2b^{2}-2b+2$, find the minimum value of $M$ using the completion of squares.<br/>Solution: $a^{2}-2ab+2b^{2}-2b+2=a^{2}-2ab+b^{2}+b^{2}-2b+1+1=\left(a-b\right)^{2}+\left(b-1\right)^{2}+1$.<br/>Since $\left(a-b\right)^{2}\geqslant 0$ and $\left(b-1\right)^{2}\geqslant 0$,<br/>Therefore, when $a=b=1$, $M$ has a minimum value of $1$.<br/>Based on the above material, solve the following problems:<br/>$(1)$ Add a constant term on the blank line to make it a perfect square: $a^{2}+4a+\_\_\_\_\_\_$.<br/>$(2)$ Factorize using the completion of squares: $a^{2}-24a+143$.<br/>$(3)$ If $M=-\frac{1}{4}a^{2}+2a-1$, find the maximum value of $M.

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