Consider the first set of fractions:
\begin{align}
\frac{2 \, x}{p (p+4)} &= \frac{2 \, x}{q (q-4)} = 3 \\
\frac{x}{p+q} &= 4
\end{align}
it would seem that the relations lead to an equation for $p$ and $q$. This follows from solving for $x$ in the second equation, $x = 4 \, (p+q)$, and using it in the first which gives
$$ \frac{8 \, (p+q)}{p (p+4)} = 3 \hspace{10mm} \frac{8 \, (p+q)}{q (q-4)} = 3 \to \frac{8}{3} \, (p+q) = p (p+4) = q (q-4). $$
This gives $p^2 + 4 \, p = q^2 - 4 \, q$ and factors to $(p+q) (p - q + 4) = 0$ which gives $q = -p$ or $q = p + 4$.
The second set of equations follows a similar pattern. First solve for $y$ to obtain $y = 4 \, (p+4)$ and then solve for $x$ which is $x = 4 \, (p+q)$. Then find the relation between $p$ and $q$ from the first line (which is $p (p+4) = q (q-4)$).