import sys
input=sys.stdin.readline
def F(N):

    if not N & 1:
        x = N >> 1
        return x & 1
    return (N - 1) ^ F(N - 1)
A, B = map(int, input().split())
answer = F(B + 1) ^ F(A)
print(answer) import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def F(N):

    if not N & 1:
        x = N >> 1
        return x & 1
    return (N - 1) ^ F(N - 1) F if not N & 1:
        x = N >> 1
        return x & 1
     not N & 1 N & 1 N 1 x = N >> 1 x N >> 1 N 1 return x & 1 x & 1 x 1 return (N - 1) ^ F(N - 1) (N - 1) ^ F(N - 1) N - 1 N 1 F(N - 1) F N - 1 N 1 N N A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B answer = F(B + 1) ^ F(A) answer F(B + 1) ^ F(A) F(B + 1) F B + 1 B 1 F(A) F A print(answer) print answer A, B = map(int, input().split()) map(int, input().split()) A answer = F(B + 1) ^ F(A) F(B + 1) ^ F(A) answer def F(N):

    if not N & 1:
        x = N >> 1
        return x & 1
    return (N - 1) ^ F(N - 1) def F(N):

    if not N & 1:
        x = N >> 1
        return x & 1
    return (N - 1) ^ F(N - 1) F input=sys.stdin.readline sys.stdin.readline input B = map(int, input().split()) map(int, input().split()) B
import sys
input=sys.stdin.readline
def F(N):

    if not N & 1:
        x = N >> 1
        return x & 1
    return (N - 1) ^ F(N - 1)
A, B = map(int, input().split())
answer = F(B + 1) ^ F(A)
print(answer)