a, b = [int(x) for x in input().split()]

def f_xor(n):
    temp = (n // 2) % 2
    if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
    return temp

if a == 0:
    print(f_xor(b))
else:
    print(f_xor(a - 1) ^ f_xor(b)) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a, b = [int(x) for x in input().split()] a [int(x) for x in input().split()] b def f_xor(n):
    temp = (n // 2) % 2
    if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
    return temp f_xor temp = (n // 2) % 2 temp (n // 2) % 2 n // 2 n 2 2 if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
     n % 2 == 0 n % 2 n 2 0 temp ^= n temp n temp ^= 1 temp 1 return temp temp n n if a == 0:
    print(f_xor(b))
else:
    print(f_xor(a - 1) ^ f_xor(b)) a == 0 a 0 print(f_xor(b)) print f_xor(b) f_xor b print(f_xor(a - 1) ^ f_xor(b)) print f_xor(a - 1) ^ f_xor(b) f_xor(a - 1) f_xor a - 1 a 1 f_xor(b) f_xor b b = [int(x) for x in input().split()] [int(x) for x in input().split()] b def f_xor(n):
    temp = (n // 2) % 2
    if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
    return temp def f_xor(n):
    temp = (n // 2) % 2
    if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
    return temp f_xor a, b = [int(x) for x in input().split()] [int(x) for x in input().split()] a
a, b = [int(x) for x in input().split()]

def f_xor(n):
    temp = (n // 2) % 2
    if n % 2 == 0:
        temp ^= n
    else:
        temp ^= 1
    return temp

if a == 0:
    print(f_xor(b))
else:
    print(f_xor(a - 1) ^ f_xor(b))