class Integer
  def cumulative_bit_count
    n = self + 1
    return [] if n <= 0

    l = n.to_s(2).size
    ret = []

    l.times do |i|
      s = 1 << i
      t = 1 << (i + 1)
      ret[i] = s * (n / t) + [n % t - s, 0].max
    end

    ret
  end
end

A, B = gets.split.map(&:to_i)

a_h = (A - 1).cumulative_bit_count
b_h = B.cumulative_bit_count

l = B.to_s(2).size

puts (0..l).map { |i| ((b_h[i] || 0) - (a_h[i] || 0)).odd? ? '1' : '0' }.reverse.join.to_i(2)

__END__
1 = (c + 1) / 2
2 = 2 * (c / 4) + [c % 4 - 1, 0].max
3 = 4 * (c / 8) + [c % 8 - 3, 0].max
4 = 8 * (c / 16) + [c % 16 - 7, 0].max
n = (2 ** i) * (c / (2 ** i)) + [c / 

