"use strict"
const main = (input) => {
  const list = input.split(" ")
  const a = parseInt(list[0])
  const b = parseInt(list[1])
  if(b%a == 0){
    console.log(a+b)
  }else{
  	console.log(b-a)
  }
}

main(require("fs").readFileSync("/dev/stdin","utf-8"))
