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())

g = a1 | a4
f = a2 & a3
e = a3 ^ a4
d = a1 | a2
c = f ^ g
b = d & e
a = b | c

print(a)