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

def f(x):
  res = 0
  while x % 4 != 3:
    res ^= x
    x -= 1
  return res

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):
  res = 0
  while x % 4 != 3:
    res ^= x
    x -= 1
  return res f res = 0 res 0 while x % 4 != 3:
    res ^= x
    x -= 1
   x % 4 != 3 x % 4 x 4 3 res ^= x res x x -= 1 x 1 return res res 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 B = map(int,input().split()) map(int,input().split()) B def f(x):
  res = 0
  while x % 4 != 3:
    res ^= x
    x -= 1
  return res def f(x):
  res = 0
  while x % 4 != 3:
    res ^= x
    x -= 1
  return res f A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())

def f(x):
  res = 0
  while x % 4 != 3:
    res ^= x
    x -= 1
  return res

print(f(A-1)^f(B))