n = int(eval(input()))

print((1 if n == 0 else 0))

n = int(eval(input()))

print((0 if n else 1))

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

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

-print((1 if n == 0 else 0)) +print((0 if n else 1))