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