module Main where

import Data.List
import Control.Monad
import Debug.Trace
import Data.Bits

solve :: Int -> Int -> Int
solve a b = foldr xor a [a+1..b]


main = do
    [a,b] <- fmap read . words <$> getLine
    print $ solve a b




