Let's determine the digits $A, B, C, D$ if the following equalities hold:

$$
(A+B \sqrt{3})^{2}=\overline{C D}+\overline{B C} \sqrt{3}, \quad(A+C \sqrt{3})^{2}=\overline{D C}+\overline{C D} \sqrt{3}
$$