
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 two sets $A = \{x \mid x^2 + px + q = 0\}$ and $B = \{x \mid qx^2 + px + 1 = 0\}$, and it is known that: (i) $A \cap B \neq \emptyset$; (ii) $-2 \in A$ (where $p, q \neq 0$), find the values of $p$ and $q$.

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