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())
d = int(input())
c = int(input())
b = int(input())

x = a|b|c|d
a=b=c=d=x

A = a|b
B = c^d
C = b&c
D = a|d

U = A&B
L = C^D

print(U|L)

