A,B=map(int, input().split())
def fanc(n):
    if n<0:
        return 0
    if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0

print(fanc(A-1)^fanc(B)) A,B=map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B def fanc(n):
    if n<0:
        return 0
    if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 fanc if n<0:
        return 0
     n<0 n 0 return 0 0 if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 n%4==0 n%4 n 4 0 return n n elif n%4==1:
        return 1
     n%4==1 n%4 n 4 1 return 1 1 elif n%4==2:
        return n+1
     n%4==2 n%4 n 4 2 return n+1 n+1 n 1 return 0 0 n n print(fanc(A-1)^fanc(B)) print fanc(A-1)^fanc(B) fanc(A-1) fanc A-1 A 1 fanc(B) fanc B def fanc(n):
    if n<0:
        return 0
    if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 def fanc(n):
    if n<0:
        return 0
    if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 fanc 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 fanc(n):
    if n<0:
        return 0
    if n%4==0:
        return n
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0

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