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

def odd(x):
    if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1

def solve(m):
    if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1)

print(solve(b) ^ solve(a - 1)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def odd(x):
    if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1 odd if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1 ( (x + 1) // 2 ) % 2 == 0 ( (x + 1) // 2 ) % 2 (x + 1) // 2 x + 1 x 1 2 2 0 return 0 0 return 1 1 x x def solve(m):
    if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1) solve if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1) m % 2 == 1 m % 2 m 2 1 return odd(m) odd(m) odd m return odd(m + 1) ^ (m + 1) odd(m + 1) ^ (m + 1) odd(m + 1) odd m + 1 m 1 m + 1 m 1 m m print(solve(b) ^ solve(a - 1)) print solve(b) ^ solve(a - 1) solve(b) solve b solve(a - 1) solve a - 1 a 1 def solve(m):
    if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1) def solve(m):
    if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1) solve b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a def odd(x):
    if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1 def odd(x):
    if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1 odd
a, b = map(int, input().split())

def odd(x):
    if ( (x + 1) // 2 ) % 2 == 0:
        return 0
    else:
        return 1

def solve(m):
    if m % 2 == 1:
        return odd(m)
    else:
        return odd(m + 1) ^ (m + 1)

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