#!/usr/bin/env python3

import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

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

def f(x):
    s = 0
    for i in range(x // 4 * 4, x + 1):
        s ^= i
    return s

print(f(a - 1) ^ f(b)) import sys sys readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 a, b = map(int, readline().split()) a map(int, readline().split()) map int readline().split() ().split () readline split b def f(x):
    s = 0
    for i in range(x // 4 * 4, x + 1):
        s ^= i
    return s f s = 0 s 0 for i in range(x // 4 * 4, x + 1):
        s ^= i
     i range(x // 4 * 4, x + 1) range x // 4 * 4 x // 4 x 4 4 x + 1 x 1 s ^= i s i return s s x x print(f(a - 1) ^ f(b)) print f(a - 1) ^ f(b) f(a - 1) f a - 1 a 1 f(b) f b a, b = map(int, readline().split()) map(int, readline().split()) a b = map(int, readline().split()) map(int, readline().split()) b def f(x):
    s = 0
    for i in range(x // 4 * 4, x + 1):
        s ^= i
    return s def f(x):
    s = 0
    for i in range(x // 4 * 4, x + 1):
        s ^= i
    return s f readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline
#!/usr/bin/env python3

import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

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

def f(x):
    s = 0
    for i in range(x // 4 * 4, x + 1):
        s ^= i
    return s

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