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()
9f448b951016246ecf3d13c67ee7deed4aa42db1
<mask token>


def input():
    return sys.stdin.readline().rstrip()


def ii():
    return int(input())


def mi():
    return map(int, input().split())


<mask token>


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)


<mask token>

<mask token>


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)


<mask token>

<mask token>


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
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
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()