#include using namespace std; int main() { int x, y; cin >> x >> y; if((x + 4) % 12 != y) cout << (x + 4) % 12 << endl; else cout << (y + 4) % 12 << endl; return 0; }