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