a, b = map(int, input().split())
def xor(x):
    num = [0 for i in range(41)]
    for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
    return num
temp = [0 for i in range(41)]
temp2 = xor(b)
temp3 = xor(a - 1)
for i in range(41):
    temp[i] += temp3[i]
    temp[i] -= temp2[i]
    temp[i] %= 2
ans = 0
for i in range(41):
    ans += temp[i] * 2 ** i
print(ans) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def xor(x):
    num = [0 for i in range(41)]
    for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
    return num xor 0 for i in range(41) for i in range(41) i range(41) range 41 for i in range(41) 0 num = [0 for i in range(41)] num [0 for i in range(41)] for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
     i range(41) range 41 temp = (x + 1) // (2 ** (i + 1)) temp (x + 1) // (2 ** (i + 1)) x + 1 x 1 2 ** (i + 1) 2 i + 1 i 1 temp2 = (x + 1) % (2 ** (i + 1)) temp2 (x + 1) % (2 ** (i + 1)) x + 1 x 1 2 ** (i + 1) 2 i + 1 i 1 num[i] += temp * (2 ** i) num[i] num i temp * (2 ** i) temp 2 ** i 2 i num[i] += max(temp2 - 2 ** i, 0) num[i] num i max(temp2 - 2 ** i, 0) max temp2 - 2 ** i temp2 2 ** i 2 i 0 return num num x x 0 for i in range(41) for i in range(41) i range(41) range 41 for i in range(41) 0 temp = [0 for i in range(41)] temp [0 for i in range(41)] temp2 = xor(b) temp2 xor(b) xor b temp3 = xor(a - 1) temp3 xor(a - 1) xor a - 1 a 1 for i in range(41):
    temp[i] += temp3[i]
    temp[i] -= temp2[i]
    temp[i] %= 2 i range(41) range 41 temp[i] += temp3[i] temp[i] temp i temp3[i] temp3 i temp[i] -= temp2[i] temp[i] temp i temp2[i] temp2 i temp[i] %= 2 temp[i] temp i 2 ans = 0 ans 0 for i in range(41):
    ans += temp[i] * 2 ** i i range(41) range 41 ans += temp[i] * 2 ** i ans temp[i] * 2 ** i temp[i] temp i 2 ** i 2 i print(ans) print ans temp2 = xor(b) xor(b) temp2 temp3 = xor(a - 1) xor(a - 1) temp3 def xor(x):
    num = [0 for i in range(41)]
    for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
    return num def xor(x):
    num = [0 for i in range(41)]
    for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
    return num xor temp = [0 for i in range(41)] [0 for i in range(41)] temp ans += temp[i] * 2 ** i temp[i] * 2 ** i ans ans = 0 0 ans b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
a, b = map(int, input().split())
def xor(x):
    num = [0 for i in range(41)]
    for i in range(41):
        temp = (x + 1) // (2 ** (i + 1))
        temp2 = (x + 1) % (2 ** (i + 1))
        num[i] += temp * (2 ** i)
        num[i] += max(temp2 - 2 ** i, 0)
    return num
temp = [0 for i in range(41)]
temp2 = xor(b)
temp3 = xor(a - 1)
for i in range(41):
    temp[i] += temp3[i]
    temp[i] -= temp2[i]
    temp[i] %= 2
ans = 0
for i in range(41):
    ans += temp[i] * 2 ** i
print(ans)