function Main(input) {
    var a = input[0];
    var b = input[1];
   }if(b%a == 0){
      console.log(a+b);
    }else{console.log(b-a);
  }

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