How to solve system of equations with modulo function? If I have a system of equations like
\begin{align}
X &= g^{(a+2)(b+2)} \bmod p, \\
Y &= g^{(a+3)(b+3)} \bmod p, \\
Z &= g^{(a+4)(b+4)} \bmod p;
\end{align}
where $p$ (a prime number), $g$ and $X$ are known and $g$ and $p$ are co-prime.
Can we find $Y$ and $Z$ in terms of $X$?
So far, I have reached here:
\begin{align}
X &= g^{(ab+2a+2b+4)} \bmod p \\
&= [g^{ab} \bmod p \cdot g^{2(a+b)} \bmod p \cdot g^4 \bmod p] \bmod p; \\ 
Y &= g^{(ab+3a+3b+9)} \bmod p \\
&= [g^{ab} \bmod p \cdot g^{3(a+b)} \bmod p \cdot g^9 \bmod p] \bmod p; \\
Z &= g^{(ab+4a+4b+16)} \bmod p \\
&= [g^{ab} \bmod p \cdot g^{4(a+b)} \bmod p \cdot g^{16} \bmod p] \bmod p. 
\end{align}
Edit: as suggested if I simplify the exponents: $u=a+2$ and $v=b+2$, I get:
\begin{align}
X &= g^{uv} \bmod p, \quad\text{and} \\
Y &= g^{(u+1)(v+1)} \bmod p.
\end{align}
Still, I cannot express $Y$ in terms of $X$.

The problem is equivalent (with the help of the comments above) to: given integers $p$ (prime) and $X,g$ (not dividible by $p$), find all $g^{u+v}$'s $\bmod p$ such that $X\equiv g^{uv}\bmod p$. Then, exhaustive search modulo the multiplicative order of $g\bmod p$ (of $w$, if any, such that $g^w\equiv X\bmod p$, and then of $u,v$ such that $w=uv$) seems the only way.
