for a in range(2): for b in range(2): for c in range(2): v1 = not ((not (a and b)) and c) v2 = not (a and (not (b and c))) if v1 != v2: print(a, b, c) exit()