fun main(args: Array<String>) {
    val (a,b) = readLine()!!.split(" ").map { it.toLong() }
    val ans = g(a-1) xor g(b)
    println(ans)
}

fun g(x:Long) = when(x%4){
    0L -> x
    1L -> 1
    2L -> x+1
    3L -> 0
    else -> 0
}