#include using namespace std; using ll = long long; #define fi first #define se second #define all(a) a.begin(),a.end() int main(){ int x,y; cin >> x >> y; if(x>y) swap(x,y); if(y-x==4) cout << (y+4)%12 << "\n"; else cout << x+4 << "\n"; return 0; }