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
    ans = 0
    for i in [A, B]:
        if i % 2 == 1:
            # 偶数個
            if (i // 2) % 2 == 1:
                i = 0
            # 奇数個
            else:
                i = 1
        else:
            if ((i-1) // 2) % 2 == 1:
                i = 0 ^ i
            else:
                i = 1 ^ i
        ans ^= i
        
    print(ans)

    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
    ans = 0
    for i in [A, B]:
        if i % 2 == 1:
            # 偶数個
            if (i // 2) % 2 == 1:
                i = 0
            # 奇数個
            else:
                i = 1
        else:
            if ((i-1) // 2) % 2 == 1:
                i = 0 ^ i
            else:
                i = 1 ^ i
        ans ^= i
        
    print(ans)

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

    return def main():
    mod = 1000000007
    
    A, B = mi()
    A -= 1
    ans = 0
    for i in [A, B]:
        if i % 2 == 1:
            # 偶数個
            if (i // 2) % 2 == 1:
                i = 0
            # 奇数個
            else:
                i = 1
        else:
            if ((i-1) // 2) % 2 == 1:
                i = 0 ^ i
            else:
                i = 1 ^ i
        ans ^= i
        
    print(ans)

    return main
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
    ans = 0
    for i in [A, B]:
        if i % 2 == 1:
            # 偶数個
            if (i // 2) % 2 == 1:
                i = 0
            # 奇数個
            else:
                i = 1
        else:
            if ((i-1) // 2) % 2 == 1:
                i = 0 ^ i
            else:
                i = 1 ^ i
        ans ^= i
        
    print(ans)

    return

main()
