a, b = gets.split(' ')

a = a.to_i
b = b.to_i

i = a
num = []
(b-a+1).times do
    num << i.to_s(2)
    i += 1
end

len = num[-1].length
num.length.times do |i|
    num[i] = num[i].rjust(len, "0")
end

ans = ''
len.times do |i|
    count = 0
    num.each do |x|
        if x[i].eql?('1') then
            count += 1
        end
    end
    if count.odd? then
        ans += '1'
    else
        ans += '0'
    end
end

print ans.to_i(2)