#include <iostream>
#include <cmath>
using namespace std;
int main() {
    int A, B;
    if (!(std::cin >> A >> B)){
        return 1;
    }
    
    if(A < 0 || B < 0) {
        std::cout << "Invalid input" << std::endl;
    } else if (A % 2 == 0 && B % 2 == 0) {
        std::cout << A * B << std::endl;
    } else if (A % 2 != 0 && B % 2 !=0){
        std::cout << A + B << std::endl;    
    }else{
        std::cout << std::abs(A - B) << std::endl;    
}

return 0;