#include int main() { int X, Y; scanf("%d %d", &X, &Y); printf("%d\n", (Y == (X + 4) % 12)? (X + 8) % 12: (X + 4) % 12); fflush(stdout); return 0; }