function Main(input) { let src = input.replace("\n", "").split(" "); let x1 = (parseInt(src[0]) + 4) % 12; let x2 = (parseInt(src[0]) + 8) % 12; let y = parseInt(src[1]); const z = (y == x1 ? x2 : x1); console.log(z); } Main(require("fs").readFileSync("/dev/stdin", "utf8")); // 解説を参考