object Main extends App {
  var num = readLine
  val a = num.split(" ")(0).toInt
  val b = num.split(" ")(1).toInt
    if (0 == a % b) {
        println(a + b)
    } else {
        println(b - a)
    }
}