'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const a = parseInt(args[0][0], 10)
	const b = parseInt(args[0][1], 10)
	if (b % a === 0) console.log(a + b)
	else console.log(b - a)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
