{"problem":{"name":"Avoid Coprime Game","description":{"content":"For two non-negative integers $x$ and $y$, let $\\gcd(x,y)$ be the greatest common divisor of $x$ and $y$ (for $x=0$, let $\\gcd(x,y)=\\gcd(y,x)=y$). There are $N$ integers on the blackboard, and the $i$","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc155_d"},"statements":[{"statement_type":"Markdown","content":"For two non-negative integers $x$ and $y$, let $\\gcd(x,y)$ be the greatest common divisor of $x$ and $y$ (for $x=0$, let $\\gcd(x,y)=\\gcd(y,x)=y$).\nThere are $N$ integers on the blackboard, and the $i$\\-th integer is $A_i$. The greatest common divisor of these $N$ integers is $1$.\nTakahashi and Aoki will play a game against each other. After initializing an integer $G$ to $0$, they will take turns performing the following operation, with Takahashi going first.\n\n*   Choose a number $a$ on the blackboard such that $\\gcd(G,a)\\neq 1$, erase it, and replace $G$ with $\\gcd(G,a)$.\n\nThe first player unable to play loses.\nFor each $i\\ (1\\leq i \\leq N)$, determine the winner when Takahashi chooses the $i$\\-th integer on the blackboard in his first turn, and then both players play optimally.\n\n## Constraints\n\n*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $2 \\leq A_i \\leq 2 \\times 10^5$\n*   The greatest common divisor of the $N$ integers $A_i \\ (1\\leq i \\leq N)$ is $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_1$ $A_2$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc155_d","tags":[],"sample_group":[["4\n2 3 4 6","Takahashi\nAoki\nTakahashi\nAoki\n\nFor instance, when Takahashi chooses the fourth integer $A_4=6$ in his first turn, Aoki can then choose the second integer $A_2=3$ to make $G=3$. Now, Takahashi cannot choose anything, so Aoki wins. Thus, the fourth line should contain `Aoki`."],["4\n2 155 155 155","Takahashi\nTakahashi\nTakahashi\nTakahashi\n\nThe blackboard may contain the same integer multiple times."],["20\n2579 25823 32197 55685 73127 73393 74033 95252 104289 114619 139903 144912 147663 149390 155806 169494 175264 181477 189686 196663","Takahashi\nAoki\nTakahashi\nAoki\nTakahashi\nTakahashi\nTakahashi\nTakahashi\nAoki\nTakahashi\nTakahashi\nAoki\nAoki\nAoki\nAoki\nAoki\nTakahashi\nTakahashi\nAoki\nTakahashi"]],"created_at":"2026-03-03 11:01:13"}}