The input consists of four lines, each line containing a single digit 0 or 1.
none
0
1
1
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
1
0
0
1
0
1
0
0
1
1
1
0
1
0
0
0
1
1
1
0
0
1
1
0
1
0
1
0
1
1
0
1
0
0
0
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
a = int(input())
b = int(input())
c = int(input())
d = int(input())
a1 = a or b
a2 =  (c and (not d) ) or ( (not c) and d)
a3 = b and c
a4 = a or d
b1 = a1 and a2
b2 =  (a3 and (not a4) ) or ( (not a3) and a4)
print(int(not(b1 or b2)))
