#include int main() { int x, y; std::cin >> x >> y; int z = (x + 4) % 12 == y ? (x + 8) % 12 : (x + 4) % 12; std::cout << z << std::endl; }