{"raw_statement":[{"iden":"statement","content":"Chess is a two-player board game played on a chessboard (a square-checkered board with 64 squares arranged in an eight-by-eight grid). In a chess game, each player begins with sixteen pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. The object of the game is to checkmate the opponent's king, whereby the king is under immediate attack (in \"check\") and there is no way to remove or defend it from attack, or force the opposing player to forfeit.\n\nCuber QQ and Quber CC are two amateur chess players, who know almost nothing about all the fancy rules in chess, perhaps except how the chessboard looks like, and they have no interest in it. Instead, they invent their own chess game. At the beginning, Cuber QQ, who has the white pieces, and Quber CC, who has the black pieces, place some of their pieces on the chessboard. Then they start to remove those pieces by turn. Cuber QQ moves first. In each turn, they must remove at least one of their own pieces (Cuber QQ can only remove white and Quber CC can only remove black). Two or more pieces can be removed together in one turn if and only if these pieces are collinear on the chessboard, meaning they should lie in the same line. Note that this line does NOT have to be in horizontal or vertical or diagnoal direction. The one who fails to make a move loses the game.\n\nNow Cuber QQ and Quber CC are both desperate to win the game. So they will do it smartly and make optimal decisions. Who do you think will win the game, eventually?\n\nThe input consists of four lines:\n\nEach position is a upper case letter in \"A\" to \"H\", followed by a digit in \"1\" to \"8\".\n\nIt is guaranteed that there are no overlapping pieces, that is, all pieces are located at different positions.\n\nIf Cuber QQ is going to win, output \"_Cuber QQ_\" without quotes. Otherwise output \"_Quber CC_\".\n\n"},{"iden":"input","content":"The input consists of four lines:  The first line is an integer $n$ ($1 <= n <= 16$), the number of white pieces on the chessboard.  The second line consists of $n$ space-separated positions, which are the positions of white pieces.  The third line is an integer $m$ ($1 <= m <= 16$), the number of black pieces on the chessboard.  The last line consists of $m$ space-separated positions, which are the positions of black pieces. Each position is a upper case letter in \"A\" to \"H\", followed by a digit in \"1\" to \"8\".It is guaranteed that there are no overlapping pieces, that is, all pieces are located at different positions."},{"iden":"output","content":"If Cuber QQ is going to win, output \"_Cuber QQ_\" without quotes. Otherwise output \"_Quber CC_\"."},{"iden":"examples","content":"Input4\nA1 B2 D4 C3\n3\nA8 D6 H7\nOutputCuber QQ\nInput4\nA1 B2 C3 D5\n4\nA8 C7 E6 G5\nOutputQuber CC\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ W \\subseteq \\{A1, A2, \\dots, H8\\} $ be the set of white pieces (Cuber QQ's pieces).  \nLet $ B \\subseteq \\{A1, A2, \\dots, H8\\} $ be the set of black pieces (Quber CC's pieces).  \nLet $ P = W \\cup B $ be the set of all pieces on the board.  \n\nA *line* is any set of two or more positions lying on a straight line in any direction (horizontal, vertical, diagonal, or arbitrary slope).  \n\n**Constraints**  \n1. $ |W| \\geq 1 $, $ |B| \\geq 0 $, $ W \\cap B = \\emptyset $.  \n2. Players alternate turns, starting with Cuber QQ.  \n3. On each turn, a player must remove at least one of their own pieces.  \n4. If a player removes multiple pieces in one turn, they must all lie on a single straight line.  \n5. A player cannot remove opponent’s pieces.  \n6. A player who cannot make a legal move loses.  \n\n**Objective**  \nDetermine the winner under optimal play:  \n- If Cuber QQ has a winning strategy, output `_Cuber QQ_`.  \n- Otherwise, output `_Quber CC_`.","simple_statement":"Two players, Cuber QQ (white) and Quber CC (black), take turns removing their own pieces from a chessboard.  \nCuber QQ goes first.  \nOn each turn, a player must remove at least one of their own pieces.  \nThey can remove multiple pieces in one turn only if all chosen pieces lie on a straight line (any direction).  \nThe player who cannot move loses.  \nBoth play optimally.  \nGiven positions of white and black pieces, determine the winner.","has_page_source":false}