fun main(args: Array<String>) {
    val (A, B) = readLine()!!.split(" ").map(String::toLong)
    val po = LongArray(42)
    po[0] = 1L
    for (i in 1 until 42) {
        po[i] = 2 * po[i-1]
    }
    var ans = 0L
    for (i in 0 until 41) {
        var le = 0L
        if (A > 0) {
            if (((A-1) and po[i]) != 0L) {
                le += (A-1) % po[i] + 1
            }
            le += ((A-1) / po[i+1]) * po[i]
        }
        var ri = 0L
        if((B and po[i]) != 0L) {
            ri += B % po[i] + 1
        }
        ri += (B / po[i+1]) * po[i]
        ans += ((ri - le) % 2) * po[i]
    }
    println(ans)
}