from itertools import *

f = lambda x, y, z, w: ((not w or y) == (not z or x), (not w or y) and (not x) == z)
rows = [(0,'?',0,0,0,1), (0,0,0,'?',0,'?'), (0,1,1,'?','?',0)]

for p in permutations('xyzw'):
    if all(any(all(a in ('?', b) for a, b in zip(r, v + f(**dict(zip(p, v)))))
               for v in product((0, 1), repeat=4)) for r in rows):
        print(*p, sep='')