import math
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

def main():
    A,B=mi()

    x_sum = 0
    ev_cnt = 0
    if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

    if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1)

if __name__ == "__main__":
    main() import math math import sys sys sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 def mi(): return map(int,input().split()) mi def ii(): return int(input()) ii def isp(): return input().split() isp def deb(text): print("-------\n{}\n-------".format(text)) deb text text def main():
    A,B=mi()

    x_sum = 0
    ev_cnt = 0
    if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

    if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1) main A,B=mi() A mi() mi B x_sum = 0 x_sum 0 ev_cnt = 0 ev_cnt 0 if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

     A % 2 == 0 A % 2 A 2 0 if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
     B%2==0 B%2 B 2 0 x_sum ^=B x_sum B ev_cnt = B//2-A//2 ev_cnt B//2-A//2 B//2 B 2 A//2 A 2 ev_cnt = math.ceil(B/2)-A//2 ev_cnt math.ceil(B/2)-A//2 math.ceil(B/2) math.ceil math ceil B/2 B 2 A//2 A 2 if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

     B%2==0 B%2 B 2 0 x_sum ^=B x_sum B x_sum ^= A x_sum A ev_cnt = B//2-math.ceil(A/2) ev_cnt B//2-math.ceil(A/2) B//2 B 2 math.ceil(A/2) math.ceil math ceil A/2 A 2 x_sum ^= A x_sum A ev_cnt = math.ceil(B/2)-math.ceil(A/2) ev_cnt math.ceil(B/2)-math.ceil(A/2) math.ceil(B/2) math.ceil math ceil B/2 B 2 math.ceil(A/2) math.ceil math ceil A/2 A 2 if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1) ev_cnt % 2 == 0 ev_cnt % 2 ev_cnt 2 0 print(x_sum) print x_sum print(x_sum^1) print x_sum^1 x_sum 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def mi(): return map(int,input().split()) def mi(): return map(int,input().split()) mi def ii(): return int(input()) def ii(): return int(input()) ii def main():
    A,B=mi()

    x_sum = 0
    ev_cnt = 0
    if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

    if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1) def main():
    A,B=mi()

    x_sum = 0
    ev_cnt = 0
    if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

    if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1) main def deb(text): print("-------\n{}\n-------".format(text)) def deb(text): print("-------\n{}\n-------".format(text)) deb def isp(): return input().split() def isp(): return input().split() isp
import math
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

def main():
    A,B=mi()

    x_sum = 0
    ev_cnt = 0
    if A % 2 == 0:
        if B%2==0:
            x_sum ^=B
            ev_cnt = B//2-A//2 
        else:
            ev_cnt = math.ceil(B/2)-A//2 
             
    else:
        if B%2==0:
            x_sum ^=B
            x_sum ^= A
            ev_cnt = B//2-math.ceil(A/2)
        else:
            x_sum ^= A
            ev_cnt = math.ceil(B/2)-math.ceil(A/2)
    

    if ev_cnt % 2 == 0:
        print(x_sum)
    else:
        print(x_sum^1)

if __name__ == "__main__":
    main()