5. In a convex quadrilateral $ABCD$, diagonal $BD$ is drawn, and a circle is inscribed in each of the resulting triangles $ABD$ and $BCD$. A line passing through vertex $B$ and the center of one of the circles intersects side $DA$ at point $M$. Here, $AM=\frac{8}{5}$ and $MD=\frac{12}{5}$. Similarly, a line passing through vertex $D$ and the center of the second circle intersects side $BC$ at point $N$. Here, $BN=\frac{30}{11}$ and $NC=\frac{25}{11}$.

a) Find the ratio $AB:CD$.

b) Find the lengths of sides $AB$ and $CD$, given that the circles are tangent to each other.