To find length $ l $ use formula:
$$ d^2 = l^2 + w^2 + h^2 $$After substituting $d = 12\, \text{cm}$, $w = 4\, \text{cm}$ and $h = 6\, \text{cm}$ we have:
$$ 12\, \text{cm}^2 = l^2 + 4\, \text{cm}^2 + 6\, \text{cm}^2 $$$$ 144\, \text{cm}^2 = l^2 + 16\, \text{cm}^2 + 36\, \text{cm}^2 $$$$ 144\, \text{cm}^2 = l^2 + 52\, \text{cm}^2 $$$$ l^2 = 144\, \text{cm}^2 - 52\, \text{cm}^2 $$ $$ l^2 = 92\, \text{cm}^2 $$ $$ l = \sqrt{ 92\, \text{cm}^2 } $$$$ l = 2 \sqrt{ 23 }\, \text{cm} $$