a,b=map(int,input().split())
c,d=0,0
if a%2==1:c=a;a+=1
if b%2==0:d=b;b-=1
print((b-a+1)//2%2^c^d) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c,d=0,0 c 0 d 0 if a%2==1:c=a;a+=1 a%2==1 a%2 a 2 1 if b%2==0:d=b;b-=1 b%2==0 b%2 b 2 0 print((b-a+1)//2%2^c^d) print (b-a+1)//2%2^c^d (b-a+1)//2%2^c (b-a+1)//2%2 (b-a+1)//2 b-a+1 b-a b a 1 2 2 c d c,d=0,0 0 c a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b d=0,0 0 d
a,b=map(int,input().split())
c,d=0,0
if a%2==1:c=a;a+=1
if b%2==0:d=b;b-=1
print((b-a+1)//2%2^c^d)