import sys
readline = sys.stdin.readline

def f(x):
    if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1

def main():
    A, B = map(int, readline().rstrip().split())
    print(f(A-1) ^ f(B))

if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline def f(x):
    if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1 f if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1 x % 2 == 0 x % 2 x 2 0 if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
     (x//2) % 2 == 0 (x//2) % 2 x//2 x 2 2 0 return x ^ 0 x ^ 0 x 0 return x ^ 1 x ^ 1 x 1 if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1 ((x+1)//2) % 2 == 0 ((x+1)//2) % 2 (x+1)//2 x+1 x 1 2 2 0 return 0 0 return 1 1 x x def main():
    A, B = map(int, readline().rstrip().split())
    print(f(A-1) ^ f(B)) main A, B = map(int, readline().rstrip().split()) A map(int, readline().rstrip().split()) map int readline().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () readline rstrip split B print(f(A-1) ^ f(B)) print f(A-1) ^ f(B) f(A-1) f A-1 A 1 f(B) f B if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.readline sys.stdin.readline readline def f(x):
    if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1 def f(x):
    if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1 f def main():
    A, B = map(int, readline().rstrip().split())
    print(f(A-1) ^ f(B)) def main():
    A, B = map(int, readline().rstrip().split())
    print(f(A-1) ^ f(B)) main
import sys
readline = sys.stdin.readline

def f(x):
    if x % 2 == 0:
        if (x//2) % 2 == 0:
            return x ^ 0
        else:
            return x ^ 1
    else:
        if ((x+1)//2) % 2 == 0:
            return 0
        else:
            return 1

def main():
    A, B = map(int, readline().rstrip().split())
    print(f(A-1) ^ f(B))

if __name__ == '__main__':
    main()