def xor(n):
    num_pair = (n - 1) // 2
    if num_pair % 2 == 0:
        counter = 1
    else:
        counter = 0

    if n % 2 == 0:
        return n ^ counter
    else:
        return counter


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

print(xor(b) ^ xor(a - 1)) def xor(n):
    num_pair = (n - 1) // 2
    if num_pair % 2 == 0:
        counter = 1
    else:
        counter = 0

    if n % 2 == 0:
        return n ^ counter
    else:
        return counter xor num_pair = (n - 1) // 2 num_pair (n - 1) // 2 n - 1 n 1 2 if num_pair % 2 == 0:
        counter = 1
    else:
        counter = 0

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

    if n % 2 == 0:
        return n ^ counter
    else:
        return counter def xor(n):
    num_pair = (n - 1) // 2
    if num_pair % 2 == 0:
        counter = 1
    else:
        counter = 0

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

    if n % 2 == 0:
        return n ^ counter
    else:
        return counter


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

print(xor(b) ^ xor(a - 1))
