There are 25 different cards dealt into a square. Each row and column is evaluated to determine the highest hand type for which its 5 cards qualify. The hand types are listed below from low to high. Note that a hand qualifies only once, and only for its highest type. For example, a Four of a Kind does not count as two pair or three of a kind.
1. Nothing: does not qualify as any of the following. Example: AC, 3H, QS, JD, 7D.
2. One Pair: contains two cards of the same rank and does not qualify for any of the following. Example: 2C, 3H, 4H, 2H, KD.
3. Two Pair: contains two cards of one rank and two cards of another and does not qualify for any of the following. Example: 2C, 3H, 4H, 2H, 4D.
4. Three of a Kind: contains three cards of the same rank and does not qualify for any of the following. Example: QS, KH, 2C, QD, QC.
5. Straight: the five cards of the hand may be sorted on rank so that an unbroken sequence of 5 ranks is formed and the hand does not qualify for any of the following. There can be cycle through Ace. That is AC, 2H, 4D, 3H, 5S forms a straight, as does JH, XD,QC, KD, AS and QC, KD, AS, 2H, 3D.
6. Flush: the five cards are all of the same suit and the hand does not qualify for any of the following. Example: 5D, AD, KD, 7D, QD.
7. Full House: the hand contains three cards of one rank and two cards of another. Example: 3C, QS, QD, 3H, 3S.
8. Four of a kind: the hand contains four cards of the same rank. Example: AS, AD, AH, 7C, AC.
9. Straight Flush: the hand meets the criteria for being both a straight and a flush.
The input will contain several test cases. The first line of the input is an integer that indicates the number of test cases, and it is followed by a blank line. Each two consecutive test cases will also be separated by a blank line.
Each test case contains 25 cards, 5 cards per line. Each card consists of two characters. The first represents the rank of the card: 'A', '2', '3', '4', '5', '6', '7', '8', '9', 'X', 'J', 'Q' and 'K', representing a number in the range from 1 to 13. The second represents the suit of the card: `S', `H', `D', `C', representing "Spade", "Heart", "Diamond" and "Club".
For each test case, output a list of 9 integers, telling how many hands of each hand type were found, from the lowest to the highest.
Two consecutive outputs should be separated by a blank line.
For the first test case of the sample input, the five rows are evaluated to Straight Flush, Straight, Pair, Flush and Three of a Kind. And the Five columns are evaluated to Four of A Kind, Full House, Two Pair, Nothing and Two Pair.