x = int(eval(input()))

if x == 0:

  print((1))

else:

  print((0))
x = int(eval(input()))

print((x^1))

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

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

-if x == 0: -    print((1)) -else: -    print((0)) +print((x ^ 1))