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

def calc(x):
      
    a = x%4

    if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
 
print(calc(b) ^ calc(a-1)) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def calc(x):
      
    a = x%4

    if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
  calc a = x%4 a x%4 x 4 if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
  a == 0 a 0 return x x elif a == 1:
        return 1
     a == 1 a 1 return 1 1 elif a == 2:
       return x^1
     a == 2 a 2 return x^1 x^1 x 1 return 0 0 x x print(calc(b) ^ calc(a-1)) print calc(b) ^ calc(a-1) calc(b) calc b calc(a-1) calc a-1 a 1 b=map(int,input().split()) map(int,input().split()) b a,b=map(int,input().split()) map(int,input().split()) a def calc(x):
      
    a = x%4

    if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
  def calc(x):
      
    a = x%4

    if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
  calc
a,b=map(int,input().split())

def calc(x):
      
    a = x%4

    if a == 0:
        return x
    elif a == 1:
        return 1
    elif a == 2:
       return x^1
    else:
        return 0
 
print(calc(b) ^ calc(a-1))
