object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val A, B = sc.nextLong()
    var res = A
    var i = A+1
    while (i <= B) {
      res = res^i
      i = i + 1
    }
    println(res)
  }
}
