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

def solve(A):
    ret=0
    res=1
    if A%4==1 or A%4==2:
        ret+=res
    dig=A%2
    res<<=1
    A>>=1
    while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
    return ret

print(solve(B)^solve(A-1)) A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B def solve(A):
    ret=0
    res=1
    if A%4==1 or A%4==2:
        ret+=res
    dig=A%2
    res<<=1
    A>>=1
    while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
    return ret solve ret=0 ret 0 res=1 res 1 if A%4==1 or A%4==2:
        ret+=res
     A%4==1 or A%4==2 A%4==1 A%4 A 4 1 A%4==2 A%4 A 4 2 ret+=res ret res dig=A%2 dig A%2 A 2 res<<=1 res 1 A>>=1 A 1 while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
     A>0 A 0 if dig==0 and A%2==1:
            ret+=res
         dig==0 and A%2==1 dig==0 dig 0 A%2==1 A%2 A 2 1 ret+=res ret res res<<=1 res 1 A>>=1 A 1 return ret ret A A print(solve(B)^solve(A-1)) print solve(B)^solve(A-1) solve(B) solve B solve(A-1) solve A-1 A 1 A,B=map(int,input().split()) map(int,input().split()) A def solve(A):
    ret=0
    res=1
    if A%4==1 or A%4==2:
        ret+=res
    dig=A%2
    res<<=1
    A>>=1
    while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
    return ret def solve(A):
    ret=0
    res=1
    if A%4==1 or A%4==2:
        ret+=res
    dig=A%2
    res<<=1
    A>>=1
    while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
    return ret solve B=map(int,input().split()) map(int,input().split()) B
A,B=map(int,input().split())

def solve(A):
    ret=0
    res=1
    if A%4==1 or A%4==2:
        ret+=res
    dig=A%2
    res<<=1
    A>>=1
    while A>0:
        if dig==0 and A%2==1:
            ret+=res
        res<<=1
        A>>=1
    return ret

print(solve(B)^solve(A-1))
