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
a1 = int(input())
a2 = int(input())
a3 = int(input())
a4 = int(input())

b1 = a1 ^ a2
b2 = a3 or a4
b3 = a2 and a3
b4 = a1 ^ a4

c1 = b1 and b2
c2 = b3 or b4

d = c1 ^ c2

print(int(d))
