A, B = list(map(int, input().split()))

ans = 0


for i in range(1, 41):
    m = 2 ** (i-1)
    n = 2 * m
    a = (A // n) * m + max(0, A % n - m)
    b = ((B+1) // n) * m + max(0, (B+1) % n - m)

    if (b-a) % 2 == 1:
        ans += m

print(ans) A, B = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split B ans = 0 ans 0 for i in range(1, 41):
    m = 2 ** (i-1)
    n = 2 * m
    a = (A // n) * m + max(0, A % n - m)
    b = ((B+1) // n) * m + max(0, (B+1) % n - m)

    if (b-a) % 2 == 1:
        ans += m i range(1, 41) range 1 41 m = 2 ** (i-1) m 2 ** (i-1) 2 i-1 i 1 n = 2 * m n 2 * m 2 m a = (A // n) * m + max(0, A % n - m) a (A // n) * m + max(0, A % n - m) (A // n) * m A // n A n m max(0, A % n - m) max 0 A % n - m A % n A n m b = ((B+1) // n) * m + max(0, (B+1) % n - m) b ((B+1) // n) * m + max(0, (B+1) % n - m) ((B+1) // n) * m (B+1) // n B+1 B 1 n m max(0, (B+1) % n - m) max 0 (B+1) % n - m (B+1) % n B+1 B 1 n m if (b-a) % 2 == 1:
        ans += m (b-a) % 2 == 1 (b-a) % 2 b-a b a 2 1 ans += m ans m print(ans) print ans A, B = list(map(int, input().split())) list(map(int, input().split())) A ans = 0 0 ans m = 2 ** (i-1) 2 ** (i-1) m B = list(map(int, input().split())) list(map(int, input().split())) B a = (A // n) * m + max(0, A % n - m) (A // n) * m + max(0, A % n - m) a ans += m m ans n = 2 * m 2 * m n b = ((B+1) // n) * m + max(0, (B+1) % n - m) ((B+1) // n) * m + max(0, (B+1) % n - m) b
A, B = list(map(int, input().split()))

ans = 0


for i in range(1, 41):
    m = 2 ** (i-1)
    n = 2 * m
    a = (A // n) * m + max(0, A % n - m)
    b = ((B+1) // n) * m + max(0, (B+1) % n - m)

    if (b-a) % 2 == 1:
        ans += m

print(ans)
