import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b = map(int, input().split())

    def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

    print(f(b) ^ f(a - 1))


if __name__ == '__main__':
    resolve() import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline f_inf = float('inf') f_inf float('inf') float 'inf' mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def resolve():
    a, b = map(int, input().split())

    def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

    print(f(b) ^ f(a - 1)) resolve a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

     f if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 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 // 4) + 1) * 4 - 1
         n % 4 == 2 n % 4 n 4 2 return ((n // 4) + 1) * 4 - 1 ((n // 4) + 1) * 4 - 1 ((n // 4) + 1) * 4 (n // 4) + 1 n // 4 n 4 1 4 1 return 0 0 n n print(f(b) ^ f(a - 1)) print f(b) ^ f(a - 1) f(b) f b f(a - 1) f a - 1 a 1 if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve mod = 10 ** 9 + 7 10 ** 9 + 7 mod input = sys.stdin.readline sys.stdin.readline input f_inf = float('inf') float('inf') f_inf def resolve():
    a, b = map(int, input().split())

    def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

    print(f(b) ^ f(a - 1)) def resolve():
    a, b = map(int, input().split())

    def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

    print(f(b) ^ f(a - 1)) resolve
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b = map(int, input().split())

    def f(n):
        if n % 4 == 0:
            return n
        elif n % 4 == 1:
            return 1
        elif n % 4 == 2:
            return ((n // 4) + 1) * 4 - 1
        else:
            return 0

    print(f(b) ^ f(a - 1))


if __name__ == '__main__':
    resolve()
