class Yukicoder def initialize a, b = gets.chomp.split(' ').map(&:to_i) if a < b puts b - 2 else puts 2000000000 - b - 1 end end end Yukicoder.new