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