#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef unsigned long long ULL; #define MEM(a,b) memset((a),(b),sizeof(a)) const LL INF = 1e9 + 7; const int N = 1e5 + 10; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); int a, b; cin >> a >> b; if (a > b) swap(a, b); if (b - a == 8) cout << b - 4 << endl; else if (a - 4 >= 0) cout << a - 4 << endl; else cout << b + 4 << endl; return 0; }