stack and parity check