check the picture below.
[tex]\bf V=3354~in^3\qquad \qquad 3354=6(w-12)(w+18)
\\\\\\
\cfrac{3354}{6}=w^2+6w-216\implies 559=w^2+6w-216
\\\\\\
0=w^2+6w-775\implies 0=(w+31)(w-25)\implies w=
\begin{cases}
-31\\
\boxed{25}
\end{cases}[/tex]
since the width is just a dimension unit, it can't be -31.
what is the length? well, the length is w + 30.