a, b = map(int, input().split())
def f(x):
    if x%2: return-(-x//2)%2
    else: return (x//2)%2+x
print(f(a-1)^f(b)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def f(x):
    if x%2: return-(-x//2)%2
    else: return (x//2)%2+x f if x%2: return-(-x//2)%2
    else: return (x//2)%2+x x%2 x 2 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, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b def f(x):
    if x%2: return-(-x//2)%2
    else: return (x//2)%2+x def f(x):
    if x%2: return-(-x//2)%2
    else: return (x//2)%2+x f
a, b = map(int, input().split())
def f(x):
    if x%2: return-(-x//2)%2
    else: return (x//2)%2+x
print(f(a-1)^f(b))