I have a polynomial in four variables and I would like to eliminate all terms that are odd in at least one of these variables. For example, if $p(x,y,z,t)=3x^2y+y^4z^2+x^2yt + x^2t^2$, then the only part that should remain is $y^4z^2+x^2y^2$ (since in the first term $y$ is of an odd degree, and in the third term both $y$ and $t$ are of odd degrees).
I found a solution in a case when we would like eliminate terms of fixed sum of degrees, but do not know how to apply similar elimination procure here. What is the simplest method to do it?