A,B=map(int,input().split())
k=A%4
AA=A+4-k
l=B%4
BB=B-l
AAA=[]
BBB=[]
for i in range(A,AA):
    AAA+=[i]
for i in range(BB,B+1):
    BBB+=[i]

def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0]
print(henkan(AAA)^henkan(BBB)) A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B k=A%4 k A%4 A 4 AA=A+4-k AA A+4-k A+4 A 4 k l=B%4 l B%4 B 4 BB=B-l BB B-l B l AAA=[] AAA [] BBB=[] BBB [] for i in range(A,AA):
    AAA+=[i] i range(A,AA) range A AA AAA+=[i] AAA [i] i for i in range(BB,B+1):
    BBB+=[i] i range(BB,B+1) range BB B+1 B 1 BBB+=[i] BBB [i] i def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0] henkan if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0] len(A)==4 or len(A)==0 len(A)==4 len(A) len A 4 len(A)==0 len(A) len A 0 return 0 0 elif len(A)==3:
        return A[0]^A[1]^A[2]
     len(A)==3 len(A) len A 3 return A[0]^A[1]^A[2] A[0]^A[1]^A[2] A[0]^A[1] A[0] A 0 A[1] A 1 A[2] A 2 elif len(A)==2:
        return A[0]^A[1]
     len(A)==2 len(A) len A 2 return A[0]^A[1] A[0]^A[1] A[0] A 0 A[1] A 1 elif len(A)==1:
        return A[0] len(A)==1 len(A) len A 1 return A[0] A[0] A 0 A A print(henkan(AAA)^henkan(BBB)) print henkan(AAA)^henkan(BBB) henkan(AAA) henkan AAA henkan(BBB) henkan BBB def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0] def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0] henkan A,B=map(int,input().split()) map(int,input().split()) A B=map(int,input().split()) map(int,input().split()) B l=B%4 B%4 l BB=B-l B-l BB AA=A+4-k A+4-k AA AAA=[] [] AAA AAA+=[i] [i] AAA BBB=[] [] BBB k=A%4 A%4 k BBB+=[i] [i] BBB
A,B=map(int,input().split())
k=A%4
AA=A+4-k
l=B%4
BB=B-l
AAA=[]
BBB=[]
for i in range(A,AA):
    AAA+=[i]
for i in range(BB,B+1):
    BBB+=[i]

def henkan(A):
    if len(A)==4 or len(A)==0:
        return 0
    elif len(A)==3:
        return A[0]^A[1]^A[2]
    elif len(A)==2:
        return A[0]^A[1]
    elif len(A)==1:
        return A[0]
print(henkan(AAA)^henkan(BBB))
