a,b=map(int, input().split())
  
a1 = a
b1 = b
if(a1%2 == 1) : a1 = a1+1
if(b1%2 == 0) : b1 = b1-1

c = (b1-a1+1)//2 % 2

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

c = (b1-a1+1)//2 % 2

ans = 0
if(a%2 == 1):ans = ans^a
if(b%2 == 0):ans = ans^b
print(ans^c)