a, b = map(int, input().split())
def f(n):
    m = n % 4
    if m == 0:return n
    if m == 1:return 1
    if m == 2:return n + 1
    if m == 3:return 0
print(f(b)^f(a-1)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def f(n):
    m = n % 4
    if m == 0:return n
    if m == 1:return 1
    if m == 2:return n + 1
    if m == 3:return 0 f m = n % 4 m n % 4 n 4 if m == 0:return n
     m == 0 m 0 if m == 1:return 1
     m == 1 m 1 if m == 2:return n + 1
     m == 2 m 2 if m == 3:retu m == 3 m 3 n n print(f(b)^f(a-1)) print f(b)^f(a-1) f(b) f b f(a-1) f a-1 a 1 def f(n):
    m = n % 4
    if m == 0:return n
    if m == 1:return 1
    if m == 2:return n + 1
    if m == 3:return 0 def f(n):
    m = n % 4
    if m == 0:return n
    if m == 1:return 1
    if m == 2:return n + 1
    if m == 3:return 0 f a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())
def f(n):
    m = n % 4
    if m == 0:return n
    if m == 1:return 1
    if m == 2:return n + 1
    if m == 3:return 0
print(f(b)^f(a-1))