import sys
from collections import Counter as cc
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


def main():
    a, b = mi()
    def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
    ans = sxor(b)^sxor(a-1)
    print(ans)


if __name__ == '__main__':
    main() import sys sys from collections import Counter as cc def input(): return sys.stdin.readline().rstrip() input def ii(): return int(input()) ii def mi(): return map(int, input().split()) mi def li(): return list(mi()) li def main():
    a, b = mi()
    def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
    ans = sxor(b)^sxor(a-1)
    print(ans) main a, b = mi() a mi() mi b def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
     sxor ret = ((x+1)//2)%2 ret ((x+1)//2)%2 (x+1)//2 x+1 x 1 2 2 if x%2 == 0:
            ret ^= x
         x%2 == 0 x%2 x 2 0 ret ^= x ret x return ret ret x x ans = sxor(b)^sxor(a-1) ans sxor(b)^sxor(a-1) sxor(b) sxor b sxor(a-1) sxor a-1 a 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def ii(): return int(input()) def ii(): return int(input()) ii def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input def li(): return list(mi()) def li(): return list(mi()) li def mi(): return map(int, input().split()) def mi(): return map(int, input().split()) mi def main():
    a, b = mi()
    def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
    ans = sxor(b)^sxor(a-1)
    print(ans) def main():
    a, b = mi()
    def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
    ans = sxor(b)^sxor(a-1)
    print(ans) main
import sys
from collections import Counter as cc
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


def main():
    a, b = mi()
    def sxor(x):
        ret = ((x+1)//2)%2
        if x%2 == 0:
            ret ^= x
        return ret
    ans = sxor(b)^sxor(a-1)
    print(ans)


if __name__ == '__main__':
    main()