import sys

input = sys.stdin.readline


def g(N):
    if N == -1:
        return 0
    r = N % 4
    if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0


def main():
    A, B = map(int, input().split())
    ans = g(A - 1) ^ g(B)
    print(ans)


if __name__ == "__main__":
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def g(N):
    if N == -1:
        return 0
    r = N % 4
    if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0 g if N == -1:
        return 0
     N == -1 N -1 return 0 0 r = N % 4 r N % 4 N 4 if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0 r == 0 r 0 return N N elif r == 1:
        return 1
     r == 1 r 1 return 1 1 elif r == 2:
        return N + 1
     r == 2 r 2 return N + 1 N + 1 N 1 return 0 0 N N def main():
    A, B = map(int, input().split())
    ans = g(A - 1) ^ g(B)
    print(ans) main A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B ans = g(A - 1) ^ g(B) ans g(A - 1) ^ g(B) g(A - 1) g A - 1 A 1 g(B) g B print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def g(N):
    if N == -1:
        return 0
    r = N % 4
    if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0 def g(N):
    if N == -1:
        return 0
    r = N % 4
    if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0 g def main():
    A, B = map(int, input().split())
    ans = g(A - 1) ^ g(B)
    print(ans) def main():
    A, B = map(int, input().split())
    ans = g(A - 1) ^ g(B)
    print(ans) main input = sys.stdin.readline sys.stdin.readline input
import sys

input = sys.stdin.readline


def g(N):
    if N == -1:
        return 0
    r = N % 4
    if r == 0:
        return N
    elif r == 1:
        return 1
    elif r == 2:
        return N + 1
    else:
        return 0


def main():
    A, B = map(int, input().split())
    ans = g(A - 1) ^ g(B)
    print(ans)


if __name__ == "__main__":
    main()
