import Data.Bits

main = do
    [a,b] <- map read. words <$> getLine :: IO [Int]
    print $ (f (a-1) `xor` f b)

f n | n <= 0 = 0
    | odd n = if odd (n `div` 2) then 0 else 1
    | otherwise = n `xor` f (n-1)