{"raw_statement":[{"iden":"problem statement","content":"You, the game master, and $N$ players play a **Hat Guessing Game**. The players line up behind one another, numbered $1$ to $N$ from front to back.\nEach player wears a red or blue hat. The colors of the hats are represented by a string $S$: player $i$ wears a red hat if the $i$\\-th character of $S$ is `R`, and a blue hat if it is `B`. You know the string $S$, but the players do not. Each player can only see the colors of hats of the players in front of them (namely, the players with smaller player numbers). Particularly, they cannot see the color of their own hat.\nThe game goes as follows.\nFirst, you count the numbers of players with red hats and those with blue hats, and tell them to all players. Then, you repeat the following sequence of events (called a **round**) $10^{100}$ times.\n\n*   You ask each player, \"Have you found out the color of your own hat?\" Each player will honestly answer `Yes` or `No` without being heard by other players.\n*   After asking all players, you announce all players who have answered `Yes`. All players can hear this announcement. Note that you just announce the player numbers and not the colors of their hats.\n\nAll players are extremely clever and know that the other players are also clever. They start answering `Yes` in the first round when the color of their hat is determined. Additionally, they know that the other players also take this strategy, and use this knowledge to infer the color of their hat.\nFor each player, find whether they will have found out the color of their own hat after all rounds.\nProcess $T$ test cases for each input file."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 100$\n*   $1 \\leq N \\leq 100$\n*   $S$ is a string of length $N$ consisting of `R` and `B`.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$case_1$\n$case_2$\n$\\vdots$\n$case_T$\n\nEach test case $case_i$ is in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"7\n3\nRBR\n4\nBRBR\n5\nBBBBB\n5\nBBBRR\n20\nBRBBRRRRBRRBRBBBRRBR\n50\nRRBRRRBBBRRRBBBRRBRRBBRBRRBBRRRRRBBBBBRRRBRBRRBRRR\n100\nBRBRBRBBRRRBBRRBRBBRBBBRBBRBBRRRRBBRRBBBBBBBBBBBBRRBBRBBRBBBBRRRRRRRRRBRBBRBBBBRBBBRBRRBRRBBRBBBBBBB"},{"iden":"sample output 1","content":"101\n0101\n11111\n10111\n10111111010101011101\n11111010111010111010101010101011111111111011111111\n1111111001111001111111010001111101011111111011011011111111111111111101111111111111010101011111111111\n\nIn the first case, the game goes as follows.\n\n*   First, you announce to all players, \"Two players wear red hats, and one wears a blue hat.\"\n*   Round $1$:\n    *   Player $1$: answers `No` to your question.\n    *   Player $2$: answers `No` to your question.\n    *   Player $3$: Because the hats of the players in front of him are red and blue, he realizes his hat is red. He answers `Yes` to your question.\n    *   You announce, \"Player $3$ answered `Yes`.\"\n*   Round $2$:\n    *   Player $1$: Assume his hat is blue. Then, player $2$ should have noticed in round $1$ that his hat is red. However, player $2$ actually answered `No`. Thus, he realizes his hat is red, and answers `Yes` to your question.\n    *   Player $2$: answers `No` to your question.\n    *   Player $3$: answers `Yes` to your question.\n    *   You announce, \"Players $1$ and $3$ answered `Yes`.\"\n*   Round $3$:\n    *   Player $1$: answers `Yes` to your question.\n    *   Player $2$: answers `No` to your question.\n    *   Player $3$: answers `Yes` to your question.\n    *   You announce, \"Players $1$ and $3$ answered `Yes`.\"\n*   $\\vdots$\n\nAfter all rounds, players $1$ and $3$ know the colors of their hats. However, player $2$ does not. More specifically, player $2$ can deny neither the possibility that $S=$`RRB` nor the possibility that $S=$`RBR` with just the information he has, so he cannot determine the color of his hat. Thus, the string `101` should be printed as the answer."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}