
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 the functions $f(x)=x^{2}-(a+1)x-4(a+5)$ and $g(x)=ax^{2}-x+5$, where $a\in\mathbb{R}$,
$(1)$ If functions $f(x)$ and $g(x)$ have a common root, find the value of $a$.
$(2)$ If there exist two positive integers $m$ and $n$ such that for $x_0\in(m,n)$, it holds that $f(x_0) < 0$ and $g(x_0) < 0$, find the maximum value of $n$ and the range of $a$ when $n$ is at its maximum value.

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