import sys

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


def resolve():
    def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

    a, b = map(int, input().split())

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


if __name__ == '__main__':
    resolve() import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 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():
    def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

    a, b = map(int, input().split())

    res = f(b) ^ f(a - 1)
    print(res) resolve def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

     f if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

     x % 2 x 2 if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
         x == 1 x 1 return 1 1 elif max(0, x - 3) % 4 == 0:
                return 0
             max(0, x - 3) % 4 == 0 max(0, x - 3) % 4 max(0, x - 3) max 0 x - 3 x 3 4 0 return 0 0 return 1 1 t = f(x - 1) t f(x - 1) f x - 1 x 1 return t ^ x t ^ x t x x x a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b res = f(b) ^ f(a - 1) res f(b) ^ f(a - 1) f(b) f b f(a - 1) f a - 1 a 1 print(res) print res if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve mod = 10 ** 9 + 7 10 ** 9 + 7 mod def resolve():
    def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

    a, b = map(int, input().split())

    res = f(b) ^ f(a - 1)
    print(res) def resolve():
    def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

    a, b = map(int, input().split())

    res = f(b) ^ f(a - 1)
    print(res) resolve f_inf = float('inf') float('inf') f_inf
import sys

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


def resolve():
    def f(x):
        if x % 2:
            if x == 1:
                return 1
            elif max(0, x - 3) % 4 == 0:
                return 0
            else:
                return 1
        else:
            t = f(x - 1)
            return t ^ x

    a, b = map(int, input().split())

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


if __name__ == '__main__':
    resolve()
