function Main(input) {
  input = input.trim()
  input = input.split(" ").map(Number);
  if(input[1]%input[0]) console.log(input[1]+input[0])
  else console.log(input[1]-input[0])
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));