a,b = list(map(int,input().split()))

c,d = list(map(int,input().split()))

if a == c:

  print((0))

else:

  print((1))
#22:04

a,b = list(map(int,input().split()))

c,d = list(map(int,input().split()))

print((int(a!=c)))
a, b = list(map(int, input().split()))
c, d = list(map(int, input().split()))
if a == c:
    print((0))
else:
    print((1))

# 22:04
a, b = list(map(int, input().split()))
c, d = list(map(int, input().split()))
print((int(a != c)))

+# 22:04 -if a == c: -    print((0)) -else: -    print((1)) +print((int(a != c)))