
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 functions $f(x)=\frac{{a+1+\ln x}}{x}$ and $g(x)=3e^{1-x}+1$, where $a$ is a real number.  
$(1)$ If $f(x)\leq e$ always holds, find the range of real number $a$.  
$(2)$ If the equation $f(x)=g(x)$ has exactly $3$ distinct real roots, find the value of real number $a$.

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