
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
Five students $A, B, C, D$, and $E$ form a team to take part in a 5-leg relay competition. If $A$ cannot run the first leg and $D$ cannot run the last leg, determine the number of ways to arrange them to run the relay.

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