a, b = map(int, input().split())

# 4つごとに区切る
def solve(n):
    m = (n // 4) * 4
    res = m
    for i in range(m + 1, n + 1):
        res ^= i
    return res

print(solve(b) ^ solve(a - 1))

 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def solve(n):
    m = (n // 4) * 4
    res = m
    for i in range(m + 1, n + 1):
        res ^= i
    return res solve m = (n // 4) * 4 m (n // 4) * 4 n // 4 n 4 4 res = m res m for i in range(m + 1, n + 1):
        res ^= i
     i range(m + 1, n + 1) range m + 1 m 1 n + 1 n 1 res ^= i res i return res res n n print(solve(b) ^ solve(a - 1)) print solve(b) ^ solve(a - 1) solve(b) solve b solve(a - 1) solve a - 1 a 1 a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b def solve(n):
    m = (n // 4) * 4
    res = m
    for i in range(m + 1, n + 1):
        res ^= i
    return res def solve(n):
    m = (n // 4) * 4
    res = m
    for i in range(m + 1, n + 1):
        res ^= i
    return res solve
a, b = map(int, input().split())

# 4つごとに区切る
def solve(n):
    m = (n // 4) * 4
    res = m
    for i in range(m + 1, n + 1):
        res ^= i
    return res

print(solve(b) ^ solve(a - 1))


