x = int(eval(input()))

print((1-x))
print((1-int(eval(input()))))
x = int(eval(input()))
print((1 - x))

print((1 - int(eval(input()))))

-x = int(eval(input())) -print((1 - x)) +print((1 - int(eval(input()))))