"use strict";
function Main(input) {
    let nums = input.split(/\s/).map((v) => v - 0);
    let a = nums[0];
    let b = nums[1];

    let ans = (b % a == 0) ? a + b : b - a;
    console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
