a,b = map(int,input().split())

def sum_xor(x):
  if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x

c = sum_xor(b)
d = sum_xor(a-1)
print(c^d) a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def sum_xor(x):
  if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x sum_xor if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x x%2!=0 x%2 x 2 0 if (x+1)/2%2==0:
      return 0
    else:
      return 1
   (x+1)/2%2==0 (x+1)/2%2 (x+1)/2 x+1 x 1 2 2 0 return 0 0 return 1 1 a = 0 a 0 if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
     ((x)//2)%2==0 ((x)//2)%2 (x)//2 x 2 2 0 a = 0 a 0 a = 1 a 1 return a^x a^x a x x x c = sum_xor(b) c sum_xor(b) sum_xor b d = sum_xor(a-1) d sum_xor(a-1) sum_xor a-1 a 1 print(c^d) print c^d c d c = sum_xor(b) sum_xor(b) c d = sum_xor(a-1) sum_xor(a-1) d b = map(int,input().split()) map(int,input().split()) b a,b = map(int,input().split()) map(int,input().split()) a def sum_xor(x):
  if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x def sum_xor(x):
  if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x sum_xor
a,b = map(int,input().split())

def sum_xor(x):
  if x%2!=0:
    if (x+1)/2%2==0:
      return 0
    else:
      return 1
  else:
    a = 0
    if ((x)//2)%2==0:
      a = 0
    else:
      a = 1
    return a^x

c = sum_xor(b)
d = sum_xor(a-1)
print(c^d)