class Chokudai
    MAX = 40
    def initialize()
        @divided = []
    end

    def count(x, mask)
        xm = x % mask
        result = [0, xm - (mask / 2) + 1].max + (x - xm) / 2
        return result
    end
    def solve(a, b)
        mask = 2
        MAX.times do |i|
            bit = (self.count(b, mask) - self.count(a - 1, mask)).abs % 2
            @divided.unshift(bit.to_s)
            mask <<= 1
        end
    end

    def answer()
        puts(@divided.join("").to_i(2))
    end
end
inputs = STDIN.readlines.map{|line|line.strip.split()}
input = inputs.shift
a = input[0].to_i
b = input[1].to_i
max = (10 ** 12).to_s(2).size
chokudai = Chokudai.new
chokudai.solve(a, b)
chokudai.answer
