process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  var input = lines[0].split(' ');
  var A = parseInt(input[0]);
  var B = parseInt(input[1]);
  if (B / A === parseInt(B / A)) {
      console.log(A + B);
} else {
          console.log(B - A);
}
});