Solution 3:
Va Vb Vc Vd Na Nb Nc Pb Pc Pd Pull-up Pull-down Vout
L H L H Off On Off Off On Off No No Z
H H L L On On Off Off On On Yes Yes X