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