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