#include<iostream>

using namespace std;

int main() {
    int A,B;
    
    if(!(cin>> A >> B)) {
        return 0;
    }
    
    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;
    }
    
    if (A > B) cout << A-B << endl;
    else cout << B-A << endl;
    
}

return 0;
}