object Main extends App {
  import scala.io.StdIn._

  val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
  if (b % a == 0) println(a + b)
  else println(b - a)
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }

}