A, B = map(int, input().split())

m = len(format(B, "b"))

a = A
b = B
AA = 0
BB = 0

if A % 2 == 1:
    a = A + 1
    AA = A
if B % 2 == 0:
    b = B - 1
    BB = B
b += 1

t = (b - a) // 2
#print(AA, b, t)
if t % 2 == 0:
    print(AA ^ BB)
else:
    print(AA ^ BB ^ 1) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B m = len(format(B, "b")) m len(format(B, "b")) len format(B, "b") format B "b" a = A a A b = B b B AA = 0 AA 0 BB = 0 BB 0 if A % 2 == 1:
    a = A + 1
    AA = A A % 2 == 1 A % 2 A 2 1 a = A + 1 a A + 1 A 1 AA = A AA A if B % 2 == 0:
    b = B - 1
    BB = B B % 2 == 0 B % 2 B 2 0 b = B - 1 b B - 1 B 1 BB = B BB B b += 1 b 1 t = (b - a) // 2 t (b - a) // 2 b - a b a 2 if t % 2 == 0:
    print(AA ^ BB)
else:
    print(AA ^ BB ^ 1) t % 2 == 0 t % 2 t 2 0 print(AA ^ BB) print AA ^ BB AA BB print(AA ^ BB ^ 1) print AA ^ BB ^ 1 AA ^ BB AA BB 1 b += 1 1 b BB = 0 0 BB a = A + 1 A + 1 a t = (b - a) // 2 (b - a) // 2 t a = A A a b = B B b B = map(int, input().split()) map(int, input().split()) B AA = A A AA b = B - 1 B - 1 b m = len(format(B, "b")) len(format(B, "b")) m BB = B B BB A, B = map(int, input().split()) map(int, input().split()) A AA = 0 0 AA
A, B = map(int, input().split())

m = len(format(B, "b"))

a = A
b = B
AA = 0
BB = 0

if A % 2 == 1:
    a = A + 1
    AA = A
if B % 2 == 0:
    b = B - 1
    BB = B
b += 1

t = (b - a) // 2
#print(AA, b, t)
if t % 2 == 0:
    print(AA ^ BB)
else:
    print(AA ^ BB ^ 1)
