x = int(eval(input()))

a = [1, 0]

print((a[x]))

x = int(eval(input()))

print((1 - x))

x = int(eval(input()))
a = [1, 0]
print((a[x]))

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

-a = [1, 0] -print((a[x])) +print((1 - x))