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