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())
a = int(a)
b = int(b)
c = int(c)
d = int(d)
n = ((a ^ b) & (c | d)) ^ ((b & c) | (a ^ d))
print(n)