$4q=a^2+27b^2$ elementary proof of uniqueness I’m trying to prove that if $q$ is prime then the representation $$4q=a^2+27b^2$$ is unique (up to sign). Any help would be appreciated.
Edit: By elementary I mean only using divisibility rules, modular arithmetic, etc.

Suppose that $4q=a^2+27b^2=c^2+27d^2$ and $a,b,c,d> 0$ (equals 0 is not possible).
We have $a^2d^2-b^2c^2\equiv 0 $ mod $q$.
Then $(ad-bc)(ad+bc)\equiv 0$ mod $q$.
If $ad+bc\equiv 0$ mod $q$, then by $16q^2=(a^2+27b^2)(c^2+27d^2)=(ac-27bd)^2+27(ad+bc)^2$, we must have $ad+bc=0$. This is impossible, so we have $ad-bc \equiv 0 $ mod $q$.
By $16q^2=(a^2+27b^2)(c^2+27d^2)=(ac+27bd)^2+27(ad-bc)^2$,
we have $ad-bc=0$. Thus, $a/c=b/d=t$ gives
$a^2+27b^2=t^2(c^2+27d^2)=c^2+27d^2$. Hence, $t^2=1$ and $t=\pm 1$. Since $a,b,c,d> 0$, we must have $a=c$ and $b=d$.
