print('w','y','x','z')
for w in range(0,2):
for y in range(0,2):
for x in range(0,2):
for z in range(0,2):
if not((x==y)or(x==w))or z or (y and (not w))==0:
print(w,y,x,z)
print('w','y','x','z')
for w in range(0,2):
for y in range(0,2):
for x in range(0,2):
for z in range(0,2):
if not((x==y)or(x==w))or z or (y and (not w))==0:
print(w,y,x,z)