The quadrilateral $ABCD$ has the following equality $\angle ABC=\angle BCD=150^{\circ}$. Moreover, $AB=18$ and $BC=24$, the equilateral triangles $\triangle APB,\triangle BQC,\triangle CRD$ are drawn outside the quadrilateral. If $P(X)$ is the perimeter of the polygon $X$, then the following equality is true $P(APQRD)=P(ABCD)+32$. Determine the length of the side $CD$.