Answer
$256$
Work Step by Step
We are given that $P=xyz~~~(a); \\ x+z=12~~~(b)\\ y+z=12~~~(c)$
or, $x=12-z~~~(d)\\ y=12-z ~~~(e)$
So, $P=(12-z)(12-z)z=z^3-24z^2+144z$
For maximum, we must have $\dfrac{dP}{dz}=0$
or, $3z^2-48z+144=0 \\ z^2-16z+48=0 \\ z^2-12z-4z+48=0\\(z-4)(z-12)=0\\ z=4,12$
Now, equations $d$ and $e$ gives: $x=0$ and $y=0$
Thus, our equation (a) becomes: $P_{max}=(8)(8)(4)=256$