Output #1
101
0101
11111
10111
10111111010101011101
11111010111010111010101010101011111111111011111111
1111111001111001111111010001111101011111111011011011111111111111111101111111111111010101011111111111
In the first case, the game goes as follows.
* First, you announce to all players, "Two players wear red hats, and one wears a blue hat."
* Round $1$:
* Player $1$: answers `No` to your question.
* Player $2$: answers `No` to your question.
* 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.
* You announce, "Player $3$ answered `Yes`."
* Round $2$:
* 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.
* Player $2$: answers `No` to your question.
* Player $3$: answers `Yes` to your question.
* You announce, "Players $1$ and $3$ answered `Yes`."
* Round $3$:
* Player $1$: answers `Yes` to your question.
* Player $2$: answers `No` to your question.
* Player $3$: answers `Yes` to your question.
* You announce, "Players $1$ and $3$ answered `Yes`."
* $\vdots$
After 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.