a, b = gets.split.map &:to_i

result = 0

(1..100000000000000).each{ |i|
	if i == 1 then
		s1 = (a + 1)/ 2
		t1 = b / 2
		s2 = a % 2
		t2 = b % 2
		
		if ((t1-s1) % 2 + s2 + t2) % 2 == 1 then
			result = 1
		else
			result = 0
		end
		
	end

	x = 2 ** i
	
	s = [a % x - x / 2, 0].max
	t = [(b + 1) % x - x / 2, 0].max

	d = (s - t).abs % 2
	
	result += d * (2 ** (i - 1))

	if x > b then
		break
	end

}

puts result
