A, B = map(int, input().split())
def f(x):
    chk = x % 4
    if chk == 0:
        return x
    if chk == 1:
        return 1
    if chk == 2:
        return x + 1
    if chk == 3:
        return 0

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

if A != 0:
    A -= 1
print(f(A) ^ f(B))