
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 people stand in a row.  
(1) How many different arrangements are there?  
(2) If person A cannot stand at the head of the line and person B cannot stand at the end, how many arrangements are there?  
(3) If person A and person B must stand next to each other, how many different arrangements are there?  
(4) If person A and person B cannot stand next to each other, how many different arrangements are there?

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