LCR

Time limit1sMemory limit128 MB

Problem

LCR is a simple game for three or more players. Each player starts with three chips, and the goal is to be the last person holding any chips.

Starting with Player 1, each player in turn rolls a set of three dice. Each die has six faces: one shows an $L$, one a $C$, one an $R$, and the remaining three show a dot. For each $L$ rolled, the player passes one chip to the player on their left (Player 2 is considered to be on the left of Player 1); for each $R$ rolled, the player passes one chip to the player on their right; for each $C$ rolled, the player puts one chip into a central pile that belongs to no player; a dot means no action. Play continues until only one player has any chips left.

In addition, the following rules apply:

  1. A player with no chips is not out of the game, since they may later gain chips from other players' rolls.
  2. A player with only 1 or 2 chips rolls only 1 or 2 dice, respectively. A player with no chips does not roll at all and simply passes the dice to the next player.

Your job is to simulate this game given a sequence of dice rolls.

Input

The input consists of multiple test cases. Each test case is one line containing an integer $n$ (the number of players in the game) and a string (the dice rolls). There are at most $10$ players in any game, and the string consists only of the characters L, C, R, and . (dot). Some test cases may contain more dice rolls than are needed (that is, a player may win before all the rolls are used). If there are not enough dice rolls left to complete a turn (for example, only two rolls remain for a player with 3 or more chips), those remaining rolls are ignored. A value of $n = 0$ marks the end of the input.

Output

For each test case, output the phrase Game i: on a single line (where $i$ is the case number, starting at 1), followed by a description of the final state of the game. This description consists of $n+1$ lines of the form

Player 1:c1
Player 2:c2
...
Player n:cn
Center:ct

where $c_1, c_2, \dots, c_n$ are the numbers of chips each player has when the simulation ends (either because some player has won or because there are no more dice rolls), and $c_t$ is the number of chips in the central pile. If some player has won, append (W) after that player's chip count; otherwise, append (*) after the chip count of the player who is next to roll. The only blank space on any line comes before the game number or before a player number. Separate consecutive test cases with a single blank line.