object Main extends App {
    var get = readLine
    var n = get.split(" ")(0).toInt
    var m = get.split(" ")(1).toInt
    var xor = 0
  var loop=0
	for(loop <- n to m){
      xor^=loop
    }
  println(xor)
}