def main():
    A, B = map(int, input().split())
    bin_B = bin(B)[2:]
    if A != 0:
        A -= 1
    bin_A = bin(A)[2:]
    cnt = [0] * len(bin_B)
    for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
    for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


    ans = 0
    for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

    print(ans)


    



if __name__ == "__main__":
    main() def main():
    A, B = map(int, input().split())
    bin_B = bin(B)[2:]
    if A != 0:
        A -= 1
    bin_A = bin(A)[2:]
    cnt = [0] * len(bin_B)
    for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
    for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


    ans = 0
    for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

    print(ans)


     main A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B bin_B = bin(B)[2:] bin_B bin(B)[2:] (B) bin B 2: 2 if A != 0:
        A -= 1
     A != 0 A 0 A -= 1 A 1 bin_A = bin(A)[2:] bin_A bin(A)[2:] (A) bin A 2: 2 cnt = [0] * len(bin_B) cnt [0] * len(bin_B) [0] 0 len(bin_B) len bin_B for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
     i range(len(bin_B)) range len(bin_B) len bin_B loop = 2 ** (i+1) loop 2 ** (i+1) 2 i+1 i 1 mod = B % loop mod B % loop B loop if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
         mod >= loop // 2 mod loop // 2 loop 2 mod -= loop // 2 mod loop // 2 loop 2 mod += 1 mod 1 mod = 0 mod 0 cnt[i] = mod cnt[i] cnt i mod cnt[i] += (B // loop) * (loop // 2) cnt[i] cnt i (B // loop) * (loop // 2) B // loop B loop loop // 2 loop 2 for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


     i range(len(bin_A)) range len(bin_A) len bin_A loop = 2 ** (i+1) loop 2 ** (i+1) 2 i+1 i 1 mod = (A) % loop mod (A) % loop A loop if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
         mod >= loop // 2 mod loop // 2 loop 2 mod -= loop // 2 mod loop // 2 loop 2 mod += 1 mod 1 mod = 0 mod 0 cnt[i] -= mod cnt[i] cnt i mod cnt[i] -= ((A) // loop) * (loop // 2) cnt[i] cnt i ((A) // loop) * (loop // 2) (A) // loop A loop loop // 2 loop 2 ans = 0 ans 0 for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

     i range(len(bin_B)) range len(bin_B) len bin_B if cnt[i] % 2 == 1:
            ans += 2 ** i

     cnt[i] % 2 == 1 cnt[i] % 2 cnt[i] cnt i 2 1 ans += 2 ** i ans 2 ** i 2 i print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    A, B = map(int, input().split())
    bin_B = bin(B)[2:]
    if A != 0:
        A -= 1
    bin_A = bin(A)[2:]
    cnt = [0] * len(bin_B)
    for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
    for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


    ans = 0
    for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

    print(ans)


     def main():
    A, B = map(int, input().split())
    bin_B = bin(B)[2:]
    if A != 0:
        A -= 1
    bin_A = bin(A)[2:]
    cnt = [0] * len(bin_B)
    for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
    for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


    ans = 0
    for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

    print(ans)


     main
def main():
    A, B = map(int, input().split())
    bin_B = bin(B)[2:]
    if A != 0:
        A -= 1
    bin_A = bin(A)[2:]
    cnt = [0] * len(bin_B)
    for i in range(len(bin_B)):
        loop = 2 ** (i+1)
        mod = B % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] = mod
        cnt[i] += (B // loop) * (loop // 2)
    for i in range(len(bin_A)):
        loop = 2 ** (i+1)
        mod = (A) % loop
        if mod >= loop // 2:
            mod -= loop // 2
            mod += 1
        else:
            mod = 0
        cnt[i] -= mod
        cnt[i] -= ((A) // loop) * (loop // 2)


    ans = 0
    for i in range(len(bin_B)):
        if cnt[i] % 2 == 1:
            ans += 2 ** i

    print(ans)


    



if __name__ == "__main__":
    main()