a,b=open(0);print((+(a[:2]!=b[:2])))
print((+(input()[:2]!=input()[:2])))
a, b = open(0)
print((+(a[:2] != b[:2])))

print((+(input()[:2] != input()[:2])))

-a, b = open(0) -print((+(a[:2] != b[:2]))) +print((+(input()[:2] != input()[:2])))