import Control.Applicative
import Data.Bits
import Data.List

main :: IO ()
main = do
  { [a,b] <- readLineInputs :: IO [Int]
  ; print $ foldl1' xor [a .. b]
  }


readLineInputs :: Read a => IO [a]
readLineInputs = map read . words <$> getLine
