#include using namespace std; int main() { int a, b; cin >> a >> b; int e = a % 4; set st = {e, e + 4, e + 8}; st.erase(a); st.erase(b); cout << *st.cbegin() << endl; return 0; }