const input = require("fs").readFileSync("/dev/stdin", "utf8");
const result = input.split(' ');
const A = parseInt(result[0]);
const B = parseInt(result[1]);
if (Number.isInteger(B/A)) {
	console.log(A + B);
} else {
  console.log(B - A);
}