'use strict'

function main(input) {
  input = input
    .trim()
    .split(' ')
    .map(Number)

  if (input[1] % input[0] == 0) {
    console.log(input[0] + input[1])
  } else {
    console.log(input[1] - input[0])
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
