
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
Let \( p \) be a prime number, and let \( n \) be a positive integer. Find the number of quadruples \(\left(a_{1}, a_{2}, a_{3}, a_{4}\right)\) with \(a_{i} \in\left\{0,1, \ldots, p^{n}-1\right\}\) for \(i=1,2,3,4\) such that
\[ p^{n} \mid\left(a_{1} a_{2}+a_{3} a_{4}+1\right) \]

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