Where is the thermostat??? on 2002 Mazda Millenia

Trying to replace thermostat, need to know where it is specifically.

2 answers
how to replace?
You'll have to remove the air filter housing, remove the water pipewhich is kind of under the distributor, and that's where the thermostat housing is. Remove the bolts and pop out the thermostat. Note the orientation of the stat istelf. When isstalling the now one, the 'jiggle' pin goes up, use a new gakset for the thermostat housing, and O-ring on the water pipe.