a, b = map(int, input().split())
if a == b:
    print(a)
else:
    bits = []
    for i in range(b.bit_length()):
        k = pow(2, i+1)
        nb, rb = divmod(b, k)
        na, ra = divmod(max(0,a-1), k)

        bb = nb*(k//2) + max(0, rb - k//2 + 1)
        aa = na*(k//2) + max(0, ra - k//2 + 1)
        bits.append((bb-aa)%2)
    # print(bits)
    print(int(''.join(map(str, bits[::-1])), 2)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if a == b:
    print(a)
else:
    bits = []
    for i in range(b.bit_length()):
        k = pow(2, i+1)
        nb, rb = divmod(b, k)
        na, ra = divmod(max(0,a-1), k)

        bb = nb*(k//2) + max(0, rb - k//2 + 1)
        aa = na*(k//2) + max(0, ra - k//2 + 1)
        bits.append((bb-aa)%2)
    # print(bits)
    print(int(''.join(map(str, bits[::-1])), 2)) a == b a b print(a) print a bits = [] bits [] for i in range(b.bit_length()):
        k = pow(2, i+1)
        nb, rb = divmod(b, k)
        na, ra = divmod(max(0,a-1), k)

        bb = nb*(k//2) + max(0, rb - k//2 + 1)
        aa = na*(k//2) + max(0, ra - k//2 + 1)
        bits.append((bb-aa)%2)
    # print(bits)
     i range(b.bit_length()) range b.bit_length() b.bit_length b bit_length k = pow(2, i+1) k pow(2, i+1) pow 2 i+1 i 1 nb, rb = divmod(b, k) nb divmod(b, k) divmod b k rb na, ra = divmod(max(0,a-1), k) na divmod(max(0,a-1), k) divmod max(0,a-1) max 0 a-1 a 1 k ra bb = nb*(k//2) + max(0, rb - k//2 + 1) bb nb*(k//2) + max(0, rb - k//2 + 1) nb*(k//2) nb k//2 k 2 max(0, rb - k//2 + 1) max 0 rb - k//2 + 1 rb - k//2 rb k//2 k 2 1 aa = na*(k//2) + max(0, ra - k//2 + 1) aa na*(k//2) + max(0, ra - k//2 + 1) na*(k//2) na k//2 k 2 max(0, ra - k//2 + 1) max 0 ra - k//2 + 1 ra - k//2 ra k//2 k 2 1 bits.append((bb-aa)%2) bits.append bits append (bb-aa)%2 bb-aa bb aa 2 print(int(''.join(map(str, bits[::-1])), 2)) print int(''.join(map(str, bits[::-1])), 2) int ''.join(map(str, bits[::-1])) ''.join '' join map(str, bits[::-1]) map str bits[::-1] bits ::-1 -1 2 ra = divmod(max(0,a-1), k) divmod(max(0,a-1), k) ra k = pow(2, i+1) pow(2, i+1) k bb = nb*(k//2) + max(0, rb - k//2 + 1) nb*(k//2) + max(0, rb - k//2 + 1) bb b = map(int, input().split()) map(int, input().split()) b nb, rb = divmod(b, k) divmod(b, k) nb a, b = map(int, input().split()) map(int, input().split()) a rb = divmod(b, k) divmod(b, k) rb aa = na*(k//2) + max(0, ra - k//2 + 1) na*(k//2) + max(0, ra - k//2 + 1) aa bits = [] [] bits na, ra = divmod(max(0,a-1), k) divmod(max(0,a-1), k) na
a, b = map(int, input().split())
if a == b:
    print(a)
else:
    bits = []
    for i in range(b.bit_length()):
        k = pow(2, i+1)
        nb, rb = divmod(b, k)
        na, ra = divmod(max(0,a-1), k)

        bb = nb*(k//2) + max(0, rb - k//2 + 1)
        aa = na*(k//2) + max(0, ra - k//2 + 1)
        bits.append((bb-aa)%2)
    # print(bits)
    print(int(''.join(map(str, bits[::-1])), 2))
