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())
if a!=b :
    e=1
else:
    e=0
if c+d!=0 :
    f=1
else:
    f=0
if b==1 and c==1 :
    g = 1
else:
    g=0
if a!=d:
    h = 1
else:
    h=0
if e*f==1:
    i = 1
else:
    i=0
if g+h!=0 :
    j = 1
else:
    j=0
if i!=j :
    print(1)
else:
    print(0)
  				 				 		 	 		 			 						