import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


def count(N):
    cnt = []
    r = 1
    while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
    return cnt


def main():
    A, B = map(int, input().split())

    cnt_A = count(A)
    cnt_B = count(B + 1)

    cnt = [b for b in cnt_B]
    for i, a in enumerate(cnt_A):
        cnt[i] -= a

    res = 0
    for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

    print(res)


if __name__ == '__main__':
    main() import sys sys import math math import bisect bisect import queue queue def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def count(N):
    cnt = []
    r = 1
    while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
    return cnt count cnt = [] cnt [] r = 1 r 1 while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
     r < N r N res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0) res (N // (2 * r)) * r + max(N % (2 * r) - r, 0) (N // (2 * r)) * r N // (2 * r) N 2 * r 2 r r max(N % (2 * r) - r, 0) max N % (2 * r) - r N % (2 * r) N 2 * r 2 r r 0 cnt.append(res) cnt.append cnt append res r *= 2 r 2 return cnt cnt N N def main():
    A, B = map(int, input().split())

    cnt_A = count(A)
    cnt_B = count(B + 1)

    cnt = [b for b in cnt_B]
    for i, a in enumerate(cnt_A):
        cnt[i] -= a

    res = 0
    for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

    print(res) main A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B cnt_A = count(A) cnt_A count(A) count A cnt_B = count(B + 1) cnt_B count(B + 1) count B + 1 B 1 b for b in cnt_B for b in cnt_B b cnt_B for b in cnt_B b cnt = [b for b in cnt_B] cnt [b for b in cnt_B] for i, a in enumerate(cnt_A):
        cnt[i] -= a

     i a enumerate(cnt_A) enumerate cnt_A cnt[i] -= a cnt[i] cnt i a res = 0 res 0 for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

     i c enumerate(cnt) enumerate cnt if c % 2 != 0:
            res += 2 ** i

     c % 2 != 0 c % 2 c 2 0 res += 2 ** i res 2 ** i 2 i print(res) print res if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def count(N):
    cnt = []
    r = 1
    while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
    return cnt def count(N):
    cnt = []
    r = 1
    while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
    return cnt count def main():
    A, B = map(int, input().split())

    cnt_A = count(A)
    cnt_B = count(B + 1)

    cnt = [b for b in cnt_B]
    for i, a in enumerate(cnt_A):
        cnt[i] -= a

    res = 0
    for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

    print(res) def main():
    A, B = map(int, input().split())

    cnt_A = count(A)
    cnt_B = count(B + 1)

    cnt = [b for b in cnt_B]
    for i, a in enumerate(cnt_A):
        cnt[i] -= a

    res = 0
    for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

    print(res) main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


def count(N):
    cnt = []
    r = 1
    while r < N:
        res = (N // (2 * r)) * r + max(N % (2 * r) - r, 0)
        cnt.append(res)
        r *= 2
    return cnt


def main():
    A, B = map(int, input().split())

    cnt_A = count(A)
    cnt_B = count(B + 1)

    cnt = [b for b in cnt_B]
    for i, a in enumerate(cnt_A):
        cnt[i] -= a

    res = 0
    for i, c in enumerate(cnt):
        if c % 2 != 0:
            res += 2 ** i

    print(res)


if __name__ == '__main__':
    main()
