x = int(eval(input()))



if x == 1:

    print("0")

else:

    print("1")

    
x = int(eval(input()))

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

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

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