x = int(eval(input()))

print((0 if x==1 else 1))
s = eval(input())

if s == '0':

  print((1))

else:

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

s = eval(input())
if s == "0":
    print((1))
else:
    print((0))

-x = int(eval(input())) -print((0 if x == 1 else 1)) +s = eval(input()) +if s == "0": +    print((1)) +else: +    print((0))