{"problem":{"name":"Bingo","description":{"content":"We have a bingo card with a $3\\times3$ grid. The square at the $i$\\-th row from the top and the $j$\\-th column from the left contains the number $A_{i, j}$. The MC will choose $N$ numbers, $b_1, b_2, ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc157_b"},"statements":[{"statement_type":"Markdown","content":"We have a bingo card with a $3\\times3$ grid. The square at the $i$\\-th row from the top and the $j$\\-th column from the left contains the number $A_{i, j}$.\nThe MC will choose $N$ numbers, $b_1, b_2, \\cdots, b_N$. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\nDetermine whether we will have a bingo when the $N$ numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq A_{i, j} \\leq 100$\n*   $A_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))$\n*   $1 \\leq N \\leq 10$\n*   $1 \\leq b_i \\leq 100$\n*   $b_i \\neq b_j (i \\neq j)$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$A_{1, 1}$ $A_{1, 2}$ $A_{1, 3}$\n$A_{2, 1}$ $A_{2, 2}$ $A_{2, 3}$\n$A_{3, 1}$ $A_{3, 2}$ $A_{3, 3}$\n$N$\n$b_1$\n$\\vdots$\n$b_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc157_b","tags":[],"sample_group":[["84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30","Yes\n\nWe will mark $A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}$, and complete the diagonal from the top-left to the bottom-right."],["41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17","No\n\nWe will mark nothing."],["60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34","Yes\n\nWe will mark all the squares."]],"created_at":"2026-03-03 11:01:14"}}