Suppose you have an expression of $x, y$: $$ y + ax + b = 0 \mod q $$ with roots $x_0, y_0 \in (0, q)$.
How can one construct a similar expression but in mod p: $$ y + A(a, b, q)\,x + B(a, b, q) = 0 \mod p(a, b, q) $$ with $p > q$, such that it has the same roots $x_0, y_0$.