A, B = map(int, input().split())
# 1..4k = 4k
# 1..(4k+1) = 1
# 1..(4k+2) = 4k+3
# 1..(4k+3) = 0

def xorall(aa):
    remz = aa % 4
    if remz == 0:
        return aa

    if remz == 1:
        return 1

    if remz == 2:
        return aa+1

    #if remz == 3:
    return 0

ans = xorall(B) ^ xorall(A-1)
print(ans) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B def xorall(aa):
    remz = aa % 4
    if remz == 0:
        return aa

    if remz == 1:
        return 1

    if remz == 2:
        return aa+1

    #if remz == 3:
    return 0 xorall remz = aa % 4 remz aa % 4 aa 4 if remz == 0:
        return aa

     remz == 0 remz 0 return aa aa if remz == 1:
        return 1

     remz == 1 remz 1 return 1 1 if remz == 2:
        return aa+1

    #if remz == 3:
     remz == 2 remz 2 return aa+1 aa+1 aa 1 return 0 0 aa aa ans = xorall(B) ^ xorall(A-1) ans xorall(B) ^ xorall(A-1) xorall(B) xorall B xorall(A-1) xorall A-1 A 1 print(ans) print ans A, B = map(int, input().split()) map(int, input().split()) A def xorall(aa):
    remz = aa % 4
    if remz == 0:
        return aa

    if remz == 1:
        return 1

    if remz == 2:
        return aa+1

    #if remz == 3:
    return 0 def xorall(aa):
    remz = aa % 4
    if remz == 0:
        return aa

    if remz == 1:
        return 1

    if remz == 2:
        return aa+1

    #if remz == 3:
    return 0 xorall ans = xorall(B) ^ xorall(A-1) xorall(B) ^ xorall(A-1) ans B = map(int, input().split()) map(int, input().split()) B
A, B = map(int, input().split())
# 1..4k = 4k
# 1..(4k+1) = 1
# 1..(4k+2) = 4k+3
# 1..(4k+3) = 0

def xorall(aa):
    remz = aa % 4
    if remz == 0:
        return aa

    if remz == 1:
        return 1

    if remz == 2:
        return aa+1

    #if remz == 3:
    return 0

ans = xorall(B) ^ xorall(A-1)
print(ans)
