import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007
    
    A, B = mi()
    
    A -= 1
    if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

    if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

    print(A ^ B)

    return

main() import sys sys from operator import itemgetter sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def ii(): return int(input()) ii def mi(): return map(int, input().split()) mi def lmi(): return list(map(int, input().split())) lmi int(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) int(input()) int input() input def iif(n): return [int(input()) for _ in range(n)] iif n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif n n def ss(): return input().split() ss def main():
    mod = 1000000007
    
    A, B = mi()
    
    A -= 1
    if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

    if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

    print(A ^ B)

    return main mod = 1000000007 mod 1000000007 A, B = mi() A mi() mi B A -= 1 A 1 if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

     A % 2 == 1 A % 2 A 2 1 if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
     (A // 2) % 2 == 1 (A // 2) % 2 A // 2 A 2 2 1 A = 0 A 0 A = 1 A 1 if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

     ((A-1) // 2) % 2 == 1 ((A-1) // 2) % 2 (A-1) // 2 A-1 A 1 2 2 1 A = 0 ^ A A 0 ^ A 0 A A = 1 ^ A A 1 ^ A 1 A if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

     B % 2 == 1 B % 2 B 2 1 if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
     (B // 2) % 2 == 1 (B // 2) % 2 B // 2 B 2 2 1 B = 0 B 0 B = 1 B 1 if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

     ((B-1) // 2) % 2 == 1 ((B-1) // 2) % 2 (B-1) // 2 B-1 B 1 2 2 1 B = 0 ^ B B 0 ^ B 0 B B = 1 ^ B B 1 ^ B 1 B print(A ^ B) print A ^ B A B return main() main def lmi(): return list(map(int, input().split())) def lmi(): return list(map(int, input().split())) lmi input = sys.stdin.readline sys.stdin.readline input def mi(): return map(int, input().split()) def mi(): return map(int, input().split()) mi def lmif(n): return [list(map(int, input().split())) for _ in range(n)] def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif def iif(n): return [int(input()) for _ in range(n)] def iif(n): return [int(input()) for _ in range(n)] iif def ss(): return input().split() def ss(): return input().split() ss def main():
    mod = 1000000007
    
    A, B = mi()
    
    A -= 1
    if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

    if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

    print(A ^ B)

    return def main():
    mod = 1000000007
    
    A, B = mi()
    
    A -= 1
    if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

    if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

    print(A ^ B)

    return main def ii(): return int(input()) def ii(): return int(input()) ii
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007
    
    A, B = mi()
    
    A -= 1
    if A % 2 == 1:
        # 偶数個
        if (A // 2) % 2 == 1:
            A = 0
        # 奇数個
        else:
            A = 1
    else:
        if ((A-1) // 2) % 2 == 1:
            A = 0 ^ A
        else:
            A = 1 ^ A

    if B % 2 == 1:
        if (B // 2) % 2 == 1:
            B = 0
        else:
            B = 1
    else:
        if ((B-1) // 2) % 2 == 1:
            B = 0 ^ B
        else:
            B = 1 ^ B

    print(A ^ B)

    return

main()
