The sides of length 4 and x are parallel to ech other. So triangles are simillar. The relation between sides are,
[tex]\begin{gathered} \frac{x}{4}=\frac{12+6}{6} \\ \frac{x}{4}=\frac{18}{6} \\ x=3\cdot4 \\ =12 \end{gathered}[/tex]So value of x is 12.