import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int z; if((x + 4) % 12 == y) z = (x + 8) % 12; else z = (x + 4) % 12; System.out.println(z); } }