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

def check(n, k):
    if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2

k = 1
ans = 0

while k <= b:
    # print(k, check(b, k), check(a, k))
    ans += abs(check(b, k) - check(a-1, k)) % 2 * k
    k *= 2

print(ans) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def check(n, k):
    if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2 check if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2 k == 1 k 1 return ((n + 1) // 2) % 2 ((n + 1) // 2) % 2 (n + 1) // 2 n + 1 n 1 2 2 return max(0, (n + 1) % (k * 2) - k) % 2 max(0, (n + 1) % (k * 2) - k) % 2 max(0, (n + 1) % (k * 2) - k) max 0 (n + 1) % (k * 2) - k (n + 1) % (k * 2) n + 1 n 1 k * 2 k 2 k 2 n n k k k = 1 k 1 ans = 0 ans 0 while k <= b:
    # print(k, check(b, k), check(a, k))
    ans += abs(check(b, k) - check(a-1, k)) % 2 * k
    k *= 2 k <= b k b ans += abs(check(b, k) - check(a-1, k)) % 2 * k ans abs(check(b, k) - check(a-1, k)) % 2 * k abs(check(b, k) - check(a-1, k)) % 2 abs(check(b, k) - check(a-1, k)) abs check(b, k) - check(a-1, k) check(b, k) check b k check(a-1, k) check a-1 a 1 k 2 k k *= 2 k 2 print(ans) print ans k *= 2 2 k b = map(int, input().split()) map(int, input().split()) b ans = 0 0 ans k = 1 1 k a, b = map(int, input().split()) map(int, input().split()) a def check(n, k):
    if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2 def check(n, k):
    if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2 check ans += abs(check(b, k) - check(a-1, k)) % 2 * k abs(check(b, k) - check(a-1, k)) % 2 * k ans
a, b = map(int, input().split())

def check(n, k):
    if k == 1:
        return ((n + 1) // 2) % 2
    else:
        return max(0, (n + 1) % (k * 2) - k) % 2

k = 1
ans = 0

while k <= b:
    # print(k, check(b, k), check(a, k))
    ans += abs(check(b, k) - check(a-1, k)) % 2 * k
    k *= 2

print(ans)