#JSUTFPC2025G. Cheat —— 出老千

Cheat —— 出老千

Statement

Ooyyyy and Paper were particularly bored during the holidays, but unfortunately, no one could accompany them to play Minecraft (the Ender Dragon had already been swiftly defeated by the powerful Ooyyyy). So they wandered around the school, hoping to find some fun. Suddenly, Da Zhangwei passed by with a deck of playing cards. Since he was already there, they decided to stay together.

Since Da Zhangwei has just arrived at this school and is exceptionally honest (bushi), he won't engage in any underhand dealings. However, the same cannot be said for Oooyyy and Paper. Therefore, Da Zhangwei strongly demands that the cards played by Oooyyy and Paper be checked after each round.

Given that a standard deck of playing cards, excluding the jokers, consists of 52 cards, and if 3 people are divided equally into 17, 17, and 18 cards respectively, it is uncertain who will have one extra card. Assuming that the suits of the playing cards are H (Hearts), D (Diamonds), C (Clubs), and S (Spades), for example, the Queen of Diamonds is DQ, the Seven of Clubs is C7, and so on. Note: The card 10 is represented by 0, such as the Ten of Hearts is H0.

Given that Da Zhangwei is a beginner, you need to write some code to help Da Zhangwei determine whether "Oooyyy" and "Paper" are cheating.

Input

The first line gives the total number of games played, denoted by nn, satisfying the condition that (1n50)(1 \leqslant n \leqslant 50).

Then, in each round, every six cards form a row. The cards played by "Oooyyy" are presented first, ending with the string OV to indicate the end of the row. Next, the cards played by "Paper" are presented in a new row, also with six cards per row and ending with the string OV with the same meaning as above.

Output

The output follows the following rules:

  1. If both players have more than 17 cards or one player has more than 18 cards, output "A" (I've never found playing cards enjoyable);

  2. If someone's card number is less than 17, output "B" (concealed, no fun, take it out);

  3. If the same card appears in all the cards played by the two players (it is impossible for two cards in a deck of playing cards to have exactly the same suit and rank), then output ``C" (just have fun, you guys);

  4. If everything is normal, output "YESINDEED" (we will play cards for a lifetime). A new line should be included after each output.

All the above criteria are outputted according to the priority described. If multiple conditions are met simultaneously, the output will be based on the lower serial number in the above list.

The output is not case-sensitive, and both YESINDEED and yEsIndEeD meet the output requirements.

Samples

2
HA D2 D3 D4 D9 CQ
S3 S2 HA HA C0 C0
SJ SJ SQ SQ C8 OV
DA D4 D6 CJ CQ CK
CA C2 S3 S6 S9 H2
H3 HA S9 SJ SQ SK
S2 S0 OV
S8 S9 C3 C9 C4 CQ
C1 D1 S5 SJ S3 S2
DA D6 D9 DJ CJ OV
D4 D3 S4 SK S7 DK
SQ C5 H6 HQ C0 H5
C2 S6 H4 H3 D5 OV
A
YESINDEED

Notes

For the first set of examples, the number of cards in Paper is greater than 18, which meets condition 1, so we directly output A;

For the second set of examples, they all meet the tests of the first three criteria, so the output is YESINDEED.