main(a,b){scanf("%d%d",&a,&b);for(;;)if((a+=4)%12!=b)break;printf("%d",a%12);}