"user strict"
const main = (input) =>{
    const line = input.split(" ");
    const a = parseInt(line[0]);
    const b = parseInt(line[1]);
    console.log(a%b===0?a+b:b-a);
}
main(require("fs").readFileSync("/dev/stdin","utf-8"))