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

# n までに2**(i-1)が何個含まれるか

def solve(n, i):
    res = 0
    mod = 2**i
    c = n // mod
    res += c*mod//2
    if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
    return res

b_list = [0]*40
a_list = [0]*40
ans = 0
for i in range(1, 41):
    num_l = solve(b, i)
    num_r = solve(a-1, i)
    num_one = num_l - num_r
    if num_one% 2 == 1:
        ans += 2**(i-1)
print(ans)
 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def solve(n, i):
    res = 0
    mod = 2**i
    c = n // mod
    res += c*mod//2
    if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
    return res solve res = 0 res 0 mod = 2**i mod 2**i 2 i c = n // mod c n // mod n mod res += c*mod//2 res c*mod//2 c*mod c mod 2 if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
     n % mod >= mod//2 n % mod n mod mod//2 mod 2 res += (n%mod - mod//2 + 1) res n%mod - mod//2 + 1 n%mod - mod//2 n%mod n mod mod//2 mod 2 1 return res res n n i i b_list = [0]*40 b_list [0]*40 [0] 0 40 a_list = [0]*40 a_list [0]*40 [0] 0 40 ans = 0 ans 0 for i in range(1, 41):
    num_l = solve(b, i)
    num_r = solve(a-1, i)
    num_one = num_l - num_r
    if num_one% 2 == 1:
        ans += 2**(i-1) i range(1, 41) range 1 41 num_l = solve(b, i) num_l solve(b, i) solve b i num_r = solve(a-1, i) num_r solve(a-1, i) solve a-1 a 1 i num_one = num_l - num_r num_one num_l - num_r num_l num_r if num_one% 2 == 1:
        ans += 2**(i-1) num_one% 2 == 1 num_one% 2 num_one 2 1 ans += 2**(i-1) ans 2**(i-1) 2 i-1 i 1 print(ans) print ans b = map(int, input().split()) map(int, input().split()) b b_list = [0]*40 [0]*40 b_list ans = 0 0 ans a, b = map(int, input().split()) map(int, input().split()) a num_l = solve(b, i) solve(b, i) num_l num_r = solve(a-1, i) solve(a-1, i) num_r a_list = [0]*40 [0]*40 a_list ans += 2**(i-1) 2**(i-1) ans def solve(n, i):
    res = 0
    mod = 2**i
    c = n // mod
    res += c*mod//2
    if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
    return res def solve(n, i):
    res = 0
    mod = 2**i
    c = n // mod
    res += c*mod//2
    if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
    return res solve num_one = num_l - num_r num_l - num_r num_one
a, b = map(int, input().split())

# n までに2**(i-1)が何個含まれるか

def solve(n, i):
    res = 0
    mod = 2**i
    c = n // mod
    res += c*mod//2
    if n % mod >= mod//2:
        res += (n%mod - mod//2 + 1)
    return res

b_list = [0]*40
a_list = [0]*40
ans = 0
for i in range(1, 41):
    num_l = solve(b, i)
    num_r = solve(a-1, i)
    num_one = num_l - num_r
    if num_one% 2 == 1:
        ans += 2**(i-1)
print(ans)

