{"problem":{"name":"3^N Minesweeper","description":{"content":"There is zero or one bomb at each of positions $0, 1, 2, \\ldots, 3^N-1$.   Let us say that positions $x$ and $y$ are **neighboring** each other if and only if the following condition is satisfied for ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc288_g"},"statements":[{"statement_type":"Markdown","content":"There is zero or one bomb at each of positions $0, 1, 2, \\ldots, 3^N-1$.  \nLet us say that positions $x$ and $y$ are **neighboring** each other if and only if the following condition is satisfied for every $i=1, \\ldots, N$.\n\n*   Let $x'$ and $y'$ be the $i$\\-th lowest digits of $x$ and $y$ in ternary representation, respectively. Then, $|x' - y'| \\leq 1$.\n\nIt is known that there are exactly $A_i$ bombs in total at the positions neighboring position $i$. Print a placement of bombs consistent with this information.\n\n## Constraints\n\n*   $1 \\leq N \\leq 12$\n*   There is a placement of bombs consistent with $A_0, A_1, \\ldots, A_{3^N-1}$.\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_0$ $A_1$ $\\ldots$ $A_{3^N-1}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc288_g","tags":[],"sample_group":[["1\n0 1 1","0 0 1\n\nPosition $0$ is neighboring positions $0$ and $1$, which have $0$ bombs in total.  \nPosition $1$ is neighboring positions $0$, $1$, and $2$, which have $1$ bomb in total.  \nPosition $2$ is neighboring positions $1$ and $2$, which have $1$ bombs in total.  \nIf there is a bomb at only position $2$, all conditions above are satisfied, so this placement is correct."],["2\n2 3 2 4 5 3 3 4 2","0 1 0 1 0 1 1 1 0"],["2\n0 0 0 0 0 0 0 0 0","0 0 0 0 0 0 0 0 0"]],"created_at":"2026-03-03 11:01:14"}}