#include using namespace std; void _main() { int x, y; cin >> x >> y; if (max(x, y) - min(x, y) != 4) cout << (x + y) / 2 << '\n'; else if (min(x, y) >= 4) cout << min(x, y) - 4 << '\n'; else cout << (max(x, y) + 4) % 12 << '\n'; } int main() { ios::sync_with_stdio(false); cin.tie(0); // cout << fixed << setprecision(15); _main(); }