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

def F(n):
    a = n//2
    if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0

ans = F(a-1) ^ F(b)
print(ans) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def F(n):
    a = n//2
    if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0 F a = n//2 a n//2 n 2 if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0 n % 2 == 0 n % 2 n 2 0 if a % 2 == 0:
            return n
        else:
            return n ^ 1
     a % 2 == 0 a % 2 a 2 0 return n n return n ^ 1 n ^ 1 n 1 if a % 2 == 0:
            return 1
        else:
            return 0 a % 2 == 0 a % 2 a 2 0 return 1 1 return 0 0 n n ans = F(a-1) ^ F(b) ans F(a-1) ^ F(b) F(a-1) F a-1 a 1 F(b) F b print(ans) print ans b = map(int, input().split()) map(int, input().split()) b def F(n):
    a = n//2
    if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0 def F(n):
    a = n//2
    if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0 F ans = F(a-1) ^ F(b) F(a-1) ^ F(b) ans a, b = map(int, input().split()) map(int, input().split()) a
a, b = map(int, input().split())

def F(n):
    a = n//2
    if n % 2 == 0:
        if a % 2 == 0:
            return n
        else:
            return n ^ 1
    else:
        if a % 2 == 0:
            return 1
        else:
            return 0

ans = F(a-1) ^ F(b)
print(ans)
