a, b = map(int, input().split())
def f(n):
    if n % 2:
        return 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else 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 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else n  f if n % 2:
        return 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else n  n % 2 n 2 return 1 if -(-n//2) % 2 else 0 1 if -(-n//2) % 2 else 0 -(-n//2) % 2 -(-n//2) -n//2 -n n 2 2 1 0 return 1 + n if (n//2) % 2 else n 1 + n if (n//2) % 2 else n (n//2) % 2 n//2 n 2 2 1 + n 1 n 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 a, b = map(int, input().split()) map(int, input().split()) a def f(n):
    if n % 2:
        return 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else n  def f(n):
    if n % 2:
        return 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else n  f b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())
def f(n):
    if n % 2:
        return 1 if -(-n//2) % 2 else 0
    else:
        return 1 + n if (n//2) % 2 else n 
print(f(a - 1) ^ f(b))