# coding: utf-8
class Case01

  def initialize
  end

  def show
    p self.instance_variables
        .map{ |sym| [sym, self.instance_variable_get(sym)] }
        .to_h
  end
  
  # 実行する
  def execute
    read
    solve
    output
  end

  def read
    @a, @b = gets.chomp.split.map(&:to_i)
  end

  def solve
    @result = (@b % @a == 0) ? (@a + @b) : (@b - @a)
  end
  
  def output
    puts @result
  end

end

# 
Case01.new.execute if $0 == __FILE__

