x=int(eval(input()))

if x==1:

  print("0")

elif x==0:

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

if x==1:

    print((0))

else:

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

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

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