All four promised functions have . Use quadratic Boolean phase cancellation: apply a Controlled-Z gate to remove the phase , then apply the Walsh-Hadamard transform. With the rightmost gate acting first, choose
Because and the Controlled-Z gate commutes with the Pauli Z gates,
The quantum measurement in the computational basis consequently produces
Each answer occurs with probability one for its promised Boolean quantum oracle.