
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 city has $n$ high schools, each with 3 students participating in the math contest, and Andrea's score was the median among all students, also being the only prime number score among all participants and the highest score on her team, and Andrea's teammates Beth and Carla placed 31st and 47th, respectively, find the value of $n$.

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