def odd_solve(n):
    return (n + 1) // 2 % 2

def solve(n):
    if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1)

a, b = map(int, input().split())
ans = solve(b) ^ solve(a - 1)
print(ans) def odd_solve(n):
    return (n + 1) // 2 % 2 odd_solve return (n + 1) // 2 % 2 (n + 1) // 2 % 2 (n + 1) // 2 n + 1 n 1 2 2 n n def solve(n):
    if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1) solve if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1) n % 2 == 1 n % 2 n 2 1 return odd_solve(n) odd_solve(n) odd_solve n return odd_solve(n + 1) ^ (n + 1) odd_solve(n + 1) ^ (n + 1) odd_solve(n + 1) odd_solve n + 1 n 1 n + 1 n 1 n n a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b ans = solve(b) ^ solve(a - 1) ans solve(b) ^ solve(a - 1) solve(b) solve b solve(a - 1) solve a - 1 a 1 print(ans) print ans def odd_solve(n):
    return (n + 1) // 2 % 2 def odd_solve(n):
    return (n + 1) // 2 % 2 odd_solve def solve(n):
    if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1) def solve(n):
    if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1) solve a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b ans = solve(b) ^ solve(a - 1) solve(b) ^ solve(a - 1) ans
def odd_solve(n):
    return (n + 1) // 2 % 2

def solve(n):
    if n % 2 == 1:
        return odd_solve(n)
    else:
        return odd_solve(n + 1) ^ (n + 1)

a, b = map(int, input().split())
ans = solve(b) ^ solve(a - 1)
print(ans)
