x = int(eval(input()))

ans = 1 if x == 0 else 0

print(ans)

print((1 if int(eval(input())) == 0 else 0))

x = int(eval(input()))
ans = 1 if x == 0 else 0
print(ans)

print((1 if int(eval(input())) == 0 else 0))

-x = int(eval(input())) -ans = 1 if x == 0 else 0 -print(ans) +print((1 if int(eval(input())) == 0 else 0))