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

def xor(n):
    m = n % 4
    if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0

print(xor(a-1)^xor(b)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def xor(n):
    m = n % 4
    if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0 xor m = n % 4 m n % 4 n 4 if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0 m == 0 m 0 return n n elif m == 1:
        return 1
     m == 1 m 1 return 1 1 elif m == 2:
        return n+1
     m == 2 m 2 return n+1 n+1 n 1 return 0 0 n n print(xor(a-1)^xor(b)) print xor(a-1)^xor(b) xor(a-1) xor a-1 a 1 xor(b) xor b a, b = map(int, input().split()) map(int, input().split()) a def xor(n):
    m = n % 4
    if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0 def xor(n):
    m = n % 4
    if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0 xor b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())

def xor(n):
    m = n % 4
    if m == 0:
        return n
    elif m == 1:
        return 1
    elif m == 2:
        return n+1
    else:
        return 0

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