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

def f(x):
    res = 0
    while x % 4 != 3:
        res ^= x
        x -= 1
    
    return res

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(x):
    res = 0
    while x % 4 != 3:
        res ^= x
        x -= 1
    
    return res f res = 0 res 0 while x % 4 != 3:
        res ^= x
        x -= 1
    
     x % 4 != 3 x % 4 x 4 3 res ^= x res x x -= 1 x 1 return res res x x 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(x):
    res = 0
    while x % 4 != 3:
        res ^= x
        x -= 1
    
    return res def f(x):
    res = 0
    while x % 4 != 3:
        res ^= x
        x -= 1
    
    return res f b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())

def f(x):
    res = 0
    while x % 4 != 3:
        res ^= x
        x -= 1
    
    return res

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