print('xywz')
for x in (0, 1):
for y in (0, 1):
for w in (0, 1):
for z in (0, 1):
F = ((x and w) or (w and z)) == ((z == y) or (y == x))
if F == 1:
print(x, y, w, z)
ошибки не будет больше