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

def f(a):
    if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
    d = 1
    while d <= a:
        d <<= 1
    d >>= 1
    return (0 if a & 1 else d) | f(a - d)

print(f(b) ^ f(a-1)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def f(a):
    if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
    d = 1
    while d <= a:
        d <<= 1
    d >>= 1
    return (0 if a & 1 else d) | f(a - d) f if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
     a <= 200 a 200 rv = 0 rv 0 for i in range(a + 1):
            rv ^= i
         i range(a + 1) range a + 1 a 1 rv ^= i rv i return rv rv d = 1 d 1 while d <= a:
        d <<= 1
     d <= a d a d <<= 1 d 1 d >>= 1 d 1 return (0 if a & 1 else d) | f(a - d) (0 if a & 1 else d) | f(a - d) 0 if a & 1 else d a & 1 a 1 0 d f(a - d) f a - d a d a a print(f(b) ^ f(a-1)) print f(b) ^ f(a-1) f(b) f b f(a-1) f a-1 a 1 a, b = map(int, input().split()) map(int, input().split()) a def f(a):
    if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
    d = 1
    while d <= a:
        d <<= 1
    d >>= 1
    return (0 if a & 1 else d) | f(a - d) def f(a):
    if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
    d = 1
    while d <= a:
        d <<= 1
    d >>= 1
    return (0 if a & 1 else d) | f(a - d) f b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())

def f(a):
    if a <= 200:
        rv = 0
        for i in range(a + 1):
            rv ^= i
        return rv
    d = 1
    while d <= a:
        d <<= 1
    d >>= 1
    return (0 if a & 1 else d) | f(a - d)

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