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

def solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
    
print(solve(A-1)^solve(B)) A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B def solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
     solve if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
     x % 4 == 0 x % 4 x 4 0 return x x elif x % 4 == 1:
        return 1
     x % 4 == 1 x % 4 x 4 1 return 1 1 elif x % 4 == 2:
        return x+1
     x % 4 == 2 x % 4 x 4 2 return x+1 x+1 x 1 elif x % 4 == 3:
        return 0
     x % 4 == 3 x % 4 x 4 3 return 0 0 x x print(solve(A-1)^solve(B)) print solve(A-1)^solve(B) solve(A-1) solve A-1 A 1 solve(B) solve B def solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
     def solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
     solve B = map(int,input().split()) map(int,input().split()) B A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())

def solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    elif x % 4 == 3:
        return 0
    
print(solve(A-1)^solve(B))