import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    A, B = map(int, readline().split())
    if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
    print(ans)

if __name__ == '__main__':
    main() import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines sys.setrecursionlimit(10 ** 8) sys.setrecursionlimit sys setrecursionlimit 10 ** 8 10 8 INF = float('inf') INF float('inf') float 'inf' MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 def main():
    A, B = map(int, readline().split())
    if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
    print(ans) main A, B = map(int, readline().split()) A map(int, readline().split()) map int readline().split() ().split () readline split B if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
     A%2==0 and B%2==0 A%2==0 A%2 A 2 0 B%2==0 B%2 B 2 0 count_1 = (B-A)//2 count_1 (B-A)//2 B-A B A 2 ans = (count_1%2)^B ans (count_1%2)^B count_1%2 count_1 2 B elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
     A%2==0 and B%2==1 A%2==0 A%2 A 2 0 B%2==1 B%2 B 2 1 count_1 = (B-A+1)//2 count_1 (B-A+1)//2 B-A+1 B-A B A 1 2 ans = count_1%2 ans count_1%2 count_1 2 elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
     A%2==1 and B%2==0 A%2==1 A%2 A 2 1 B%2==0 B%2 B 2 0 count_1 = (B-A-1)//2 count_1 (B-A-1)//2 B-A-1 B-A B A 1 2 ans = A^B^(count_1%2) ans A^B^(count_1%2) A^B A B count_1%2 count_1 2 count_1 = (B-A)//2 count_1 (B-A)//2 B-A B A 2 ans = A^(count_1%2) ans A^(count_1%2) A count_1%2 count_1 2 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD read = sys.stdin.buffer.read sys.stdin.buffer.read read INF = float('inf') float('inf') INF readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline def main():
    A, B = map(int, readline().split())
    if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
    print(ans) def main():
    A, B = map(int, readline().split())
    if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
    print(ans) main
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    A, B = map(int, readline().split())
    if A%2==0 and B%2==0:
        count_1 = (B-A)//2
        ans = (count_1%2)^B
    elif A%2==0 and B%2==1:
        count_1 = (B-A+1)//2
        ans = count_1%2
    elif A%2==1 and B%2==0:
        count_1 = (B-A-1)//2
        ans = A^B^(count_1%2)
    else:
        count_1 = (B-A)//2
        ans = A^(count_1%2)
    print(ans)

if __name__ == '__main__':
    main()