#include using namespace std; int main(){ int X, Y; cin >> X >> Y; int a = (X + 4) % 12, b = (X + 8) % 12; cout << (Y ^ a ^ b) << endl; }