function Main(input) {
    var a = parseInt(input, 10);
    var b = parseInt(input, 10);
    if(b%a == 0){
      console.log(a+b);
    }else{
      console.log(b-a);
  }
}
   
Main(require("fs").readFileSync("/dev/stdin", "utf8"));