
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 universal set $U = \mathbb{R}$, sets $A=\{x|\frac{1}{x-3}＜-1\}$, $B=\{x|\frac{x-(a^{2}+2)}{x-a}＜0\}$.  
$(1)$ If $A\cap B\neq \varnothing$, find the range of real number $a$.  
$(2)$ Proposition $p: x\in A$, proposition $q: x\in B$. If $q$ is a necessary condition for $p$, find the range of real number $a$.

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