var stdin = require("fs").readFileSync("/dev/stdin", "utf8");
stdin = stdin.trim().split("\n").reverse();
function input(){return stdin.pop()}
var stdout = [];



var [a,b] = input().split(" ").map(n=>parseInt(n));
if (b % a){
    stdout.push(b - a)
}else{
    stdout.push(b + a)
}



stdout = stdout.join(" ");
console.log(stdout);