
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 that the lengths of two sides of a triangle are $5$ and $7$, and the length of the third side is $a$.  
$(1)$ Find the range of values for $a$;  
$(2)$ If $a$ is an integer, for what value of $a$ does the triangle have the maximum perimeter, and what is the maximum perimeter?

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